﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

using H2.NET.Business;

namespace H2.NET.Web.Pages
{
    public partial class Planning : TaskControl
    {
        #region 属性 Public
        public string FORM
        {
            get
            {
                return (Parent as TabMaterial).Status.FORM;
            }
        }

        public string Category
        {
            get
            {
                return (Parent as TabMaterial).Status.Category;
            }
        }

        public string Action
        {
            get
            {
                return (Parent as TabMaterial).Status.Planning;
            }
        }

        //public string KeyWord
        //{
        //    get
        //    {
        //        return (Parent as TabMaterial).Status.KeyWord;
        //    }
        //}

        private bool IsLoaded
        {
            get
            {
                return ViewState["IsLoaded"] == null ? false : (bool)ViewState["IsLoaded"];
            }
            set { ViewState["IsLoaded"] = value; }
        }

        private string Type
        {
            get
            {
                return ViewState["Type"] == null ? "1" : (string)ViewState["Type"];
            }
            set { ViewState["Type"] = value; }
        }

        private bool IsUsed
        {
            get
            {
                //return !(string.IsNullOrEmpty(FORM) || string.IsNullOrEmpty(Action)
                //        || (FORM != "FORM-001" && FORM != "FORM-002" && FORM != "FORM-005" && FORM != "FORM-009" && FORM != "FORM-010" && FORM != "FORM-012" && FORM != "FORM-062" && FORM != "FORM-064" && FORM != "FORM-035" && FORM != "FORM-036" && FORM != "FORM-043" && FORM != "FORM-031" && FORM != "FORM-074"));
                return !string.IsNullOrEmpty(Action);
            }
        }
        public string SheetStep
        {
            get
            {
                return ViewState["SheetStep"] == null ? "" : (string)ViewState["SheetStep"];
            }
            set { ViewState["SheetStep"] = value; }
        }

        #endregion

        #region 事件 页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Visible = IsUsed;
        }
        #endregion

        #region Procurement_Type
        protected void PLA_Procurement_Type_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(PLA_Special_Procurement.SelectedItem.Text))
            {
                if (TaskAPI.Process != "TW Pack Material Maintenance" && TaskAPI.Process != "TW Raw Code Application")
                {
                    SetForeColor(PLA_Procurement_Type.SelectedValue.StartsWith("F") && (Type == "1" || Type == "2") ? Color.Blue : Color.Black, PLA_Special_Procurement_L);

                }
            }
        }
        protected void PLA_Special_Procurement_SelectedIndexChanged(object sender, EventArgs e)
        {
            SetForeColor(Color.Orange, PLA_Stock_Det_Grp_L);

            if (PLA_Special_Procurement.SelectedValue == "10")
            {
                PLA_Stock_Det_Grp.Text = "0001";
            }
            else
            {
                PLA_Stock_Det_Grp.Text = "";
            }
            SetEnable(false, PLA_Stock_Det_Grp);
        }
        #endregion

        #region Lot_Size
        protected void PLA_Lot_Size_TextChanged(object sender, EventArgs e)
        {
            SetForeColor(PLA_Lot_Size.Text.Length >= 2 && PLA_Lot_Size.Text.StartsWith("FX") && (Type == "1" || Type == "2") && Action == "C" ? Color.Blue : Color.Black, PLA_Fix_Lot_Size_L);
        }
        #endregion

        #region Fix Lot Size PLA_Maximum_Lot_Size_TextChanged
        protected void PLA_Fix_Lot_Size_TextChanged(object sender, EventArgs e)
        {
            //if (TaskAPI.Process == "TW FINI Code Application" || TaskAPI.Process == "TW NPL Application-PKG" || TaskAPI.Process == "TW MTO Application-PKG" || TaskAPI.Process == "TW MTO Application-DECO" || TaskAPI.Process == "TW NPL Application-DECO")
            if (TaskAPI.Process.Contains("TW"))
            {
                if (!string.IsNullOrEmpty(PLA_Fix_Lot_Size.Text))
                {
                    (Page as PMDC).TabMaterial2.Finance1.FIN_Costing_Lot_Size.Text = PLA_Fix_Lot_Size.Text;
                    (Page as PMDC).TabMaterial2.Finance1.FIN_Price_Unit.Text = PLA_Fix_Lot_Size.Text;
                    (Page as PMDC).TabMaterial1.Finance1.FIN_Costing_Lot_Size.Text = PLA_Fix_Lot_Size.Text;
                    (Page as PMDC).TabMaterial1.Finance1.FIN_Price_Unit.Text = PLA_Fix_Lot_Size.Text;
                }
                else
                {
                    (Page as PMDC).TabMaterial2.Finance1.FIN_Costing_Lot_Size.Text = "1000";
                    (Page as PMDC).TabMaterial2.Finance1.FIN_Price_Unit.Text = "1000";
                    (Page as PMDC).TabMaterial1.Finance1.FIN_Costing_Lot_Size.Text = "1000";
                    (Page as PMDC).TabMaterial1.Finance1.FIN_Price_Unit.Text = "1000";
                }
            }
            //if (TaskAPI.Process == "TW MTO Application-DECO")
            //{
            //    if (!string.IsNullOrEmpty(PLA_Fix_Lot_Size.Text))
            //    {
            //        (Page as PMDC).TabMaterial2.Finance1.FIN_Costing_Lot_Size.Text = PLA_Fix_Lot_Size.Text;
            //    }
            //    else
            //    {
            //        (Page as PMDC).TabMaterial2.Finance1.FIN_Costing_Lot_Size.Text = "200";
            //    }
            //}

        }
        #endregion

        #region PLA_Maximum_Lot_Size_TextChanged
        protected void PLA_Maximum_Lot_Size_TextChanged(object sender, EventArgs e)
        {
            if (TaskAPI.Process.Contains("TW"))
            {
                if (string.IsNullOrEmpty(PLA_Fix_Lot_Size.Text))
                {
                    if (!string.IsNullOrEmpty(PLA_Maximum_Lot_Size.Text))
                    {
                        (Page as PMDC).TabMaterial2.Finance1.FIN_Costing_Lot_Size.Text = PLA_Maximum_Lot_Size.Text;
                        (Page as PMDC).TabMaterial2.Finance1.FIN_Price_Unit.Text = PLA_Maximum_Lot_Size.Text;
                        (Page as PMDC).TabMaterial1.Finance1.FIN_Costing_Lot_Size.Text = PLA_Maximum_Lot_Size.Text;
                        (Page as PMDC).TabMaterial1.Finance1.FIN_Price_Unit.Text = PLA_Maximum_Lot_Size.Text;
                    }

                }
            }

        }
        #endregion

        #region Overdely_Tol
        protected void PLA_Overdely_Tol_TextChanged(object sender, EventArgs e)
        {
            if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("P"))
            {
                PLA_Unlimited.Checked = string.IsNullOrEmpty(PLA_Overdely_Tol.Text.Trim());
            }
        }
        #endregion

        #region Consumption_Mode
        protected void PLA_Consumption_Mode_SelectedIndexChanged(object sender, EventArgs e)
        {
            SetForeColor(Color.Black, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L);
            if (FORM.Contains("T"))
            {
                return;
            }
            if (Type == "1" || Type == "2")
            {
                switch (PLA_Consumption_Mode.SelectedValue)
                {
                    case "1":
                        SetForeColor(Color.Blue, PLA_Bwd_Comsumption_L);
                        break;

                    case "2":
                    case "4":

                        SetForeColor(Color.Blue, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L);
                        break;

                    case "3":
                        SetForeColor(Color.Blue, PLA_Fwd_Comsumption_L);
                        break;
                }
            }
        }
        #endregion

        #region Plant选中事件
        public void PLA_Plant_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (TaskAPI.Process == "TW NPL Application-PKG")
            {
                if (FORM == "FORM-TW-011")
                {
                    return;
                }

                if (PLA_Plant.SelectedValue.Contains("D"))
                {
                    SetVisible(true, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                }
                else
                {
                    SetVisible(false, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                }
                return;
            }
            if (TaskAPI.Process == "TW Pack Material Maintenance")
            {
                SetVisible(true, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                return;
            }
            //Tang Bin 添加
            if (TaskAPI.Process == "TW FINI Code Application")
            {
                if (FORM == "FORM-TW-007")
                {
                    if ((Page as PMDC).Actions.SelectedValue == "Extend")
                    {
                        SetForeColor(Color.Blue, PLA_MRP_Type_L);
                        if (PLA_Plant.SelectedValue.Contains("P"))
                        {
                            SetForeColor(Color.Blue, PLA_Availability_Check_L);
                        }
                        if (PLA_Plant.SelectedValue.Contains("D"))
                        {
                            PLA_Availability_Check.Text = "Z1";
                            SetVisible(false, PLA_Rounding_Value_L, PLA_Rounding_Value);
                            SetEnable(false, PLA_Availability_Check);
                            SetForeColor(Color.Orange, PLA_Availability_Check_L);
                        }
                    }
                    if ((Page as PMDC).Actions.SelectedValue == "Revision")
                    {
                        SetForeColor(Color.Black, PLA_MRP_Type_L, PLA_Availability_Check_L, PLA_Plant);
                        if (PLA_Plant.SelectedValue.Contains("P"))
                        {
                            SetVisible(true, PLA_Rounding_Value_L, PLA_Rounding_Value);
                        }
                        if (PLA_Plant.SelectedValue.Contains("D"))
                        {
                            SetVisible(false, PLA_Rounding_Value_L, PLA_Rounding_Value);
                            PLA_Availability_Check.Text = "Z1";
                            SetEnable(false, PLA_Availability_Check);
                            SetForeColor(Color.Orange, PLA_Availability_Check_L);
                        }
                    }
                }
            }
            if (TaskAPI.Process == "TW NPL Application-PKG" && FORM == "FORM-TW-010")
            {
                if (PLA_Plant.SelectedValue.Contains("D"))
                {
                    PLA_Availability_Check.Text = "Z1";
                }
            }
            if (TaskAPI.Process == "TW FINI Code Application" || TaskAPI.Process == "TW NPL Application-DECO")
            {
                if (!PLA_Plant.SelectedValue.Contains("D"))
                {
                    SetVisible(false, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                }
                else
                {
                    SetVisible(true, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                }
                if (FORM != "FORM-TW-007")
                {
                    return;
                }
                if (PLA_Plant.SelectedValue.Contains("D"))
                {
                    SetVisible(false, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    PLA_Storage_Location.Text = "0035 0060 0070 0080 0090";
                    PLA_Purchasing_Group.SelectedValue = "ZFM";
                    PLA_MRP_Group.Text = "FINI";
                    //PLA_MRP_Type.Text = "Z1";
                    PLA_Procurement_Type.SelectedValue = "F";
                    PLA_Special_Procurement.SelectedValue = "W1";
                    PLA_Storage_Loc_For_EP.Text = "0010";
                    PLA_Planned_Delivery_Time.Text = "1";
                    PLA_Strategy_Group.SelectedValue = "40";
                    PLA_Consumption_Mode.Text = "2";
                    PLA_Fwd_Comsumption.Text = "15";
                    PLA_Bwd_Comsumption.Text = "15";
                    PLA_Forecast_Model.SelectedValue = "N";
                    PLA_Unlimited.Checked = false;
                    PLA_Selection_Method.SelectedValue = "";
                    PLA_Product_Scheduling.Text = "";
                    PLA_Purchasing_Group.SelectedValue = "ZFM";
                    SetForeColor(Color.Orange, PLA_Fwd_Comsumption_L, PLA_Bwd_Comsumption_L, PLA_Special_Procurement_L);
                }
                else if (PLA_Plant.SelectedValue.Contains("P"))
                {
                    SetVisible(true, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    PLA_Storage_Location.Text = "KT1D 0035 0060";
                    PLA_Purchasing_Group.SelectedValue = "";
                    PLA_MRP_Group.Text = "ATP";
                    //PLA_MRP_Type.Text = "M0";
                    PLA_Procurement_Type.SelectedValue = "E";
                    PLA_Special_Procurement.SelectedValue = "";
                    PLA_Storage_Loc_For_EP.Text = "KT1D";
                    PLA_Planned_Delivery_Time.Text = "";
                    PLA_Strategy_Group.SelectedValue = "";
                    PLA_Consumption_Mode.Text = "";
                    PLA_Fwd_Comsumption.Text = "";
                    PLA_Bwd_Comsumption.Text = "";
                    PLA_Forecast_Model.Text = "";
                    PLA_Unlimited.Checked = true;
                    PLA_Selection_Method.SelectedValue = "3";
                    PLA_Product_Scheduling.Text = "Z00001";
                    PLA_Purchasing_Group.SelectedValue = "";

                }
                else
                {
                    SetVisible(true, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    PLA_Storage_Location.Text = "";
                    PLA_Purchasing_Group.SelectedValue = "";
                    PLA_MRP_Group.Text = "";
                    PLA_MRP_Type.Text = "";
                    PLA_Procurement_Type.SelectedValue = "";
                    PLA_Special_Procurement.SelectedValue = "";
                    PLA_Storage_Loc_For_EP.Text = "";
                    PLA_Planned_Delivery_Time.Text = "";
                    PLA_Strategy_Group.SelectedValue = "";
                    PLA_Consumption_Mode.Text = "";
                    PLA_Fwd_Comsumption.Text = "";
                    PLA_Bwd_Comsumption.Text = "";
                    PLA_Forecast_Model.Text = "";
                    PLA_Unlimited.Checked = false;
                    PLA_Selection_Method.SelectedValue = "";
                    PLA_Product_Scheduling.Text = "";
                    PLA_Purchasing_Group.SelectedValue = "";
                }


                return;
            }
            if ((Category == "SEFI" || Category == "PACK") && Action == "C")
            {
                SetNPLPlant("");
            }
            if (Category == "FINI" && Action == "C" && TaskAPI.IsAllowSubmit)
            {
                SetNPLPlant("");
                PLA_Unlimited.Enabled = true;
                SetForeColor(Color.Black, PLA_Prod_Stor_Loc_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Individual_Coll_L, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Individual_Coll_L, PLA_Forecast_Model_L);
                if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("P"))
                {
                    SetForeColor(Color.Blue, PLA_Prod_Stor_Loc_L);
                    PLA_Unlimited.Enabled = false;
                    PLA_Overdely_Tol_TextChanged(null, e); //重新计算 Overdely_Tol 逻辑
                    SetForeColor(Color.Orange, PLA_Selection_Method_L);
                    SetEnable(false, PLA_Selection_Method);
                    PLA_Selection_Method.SelectedValue = "3";
                    SetVisible(false, PLA_Forecast_Model, PLA_Forecast_Model_L);
                    SetForeColor(Color.Black, PLA_Purchasing_Group_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L);
                    SetEnable(true, PLA_Individual_Coll);
                }

                if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("D"))
                {
                    if (TaskAPI.Process == "P-Plant Extend Application")
                    {
                        SetForeColor(Color.Blue, PLA_Special_Procurement_L);
                    }
                    SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Purchasing_Group_L);
                    PLA_Unlimited.Checked = false;
                    if (FORM != "FORM-015" && TaskAPI.Process != "TW Raw Code Application")
                    {
                        SetVisible(true, PLA_Purchasing_Group, PLA_Forecast_Model, PLA_Purchasing_Group_L, PLA_Forecast_Model_L);
                    }
                    //SetForeColor(Color.Blue, PLA_Purchasing_Group_L);
                    SetForeColor(Color.Black, PLA_Selection_Method_L);
                    SetEnable(true, PLA_Selection_Method);
                    PLA_Selection_Method.SelectedIndex = -1;
                    //SetEnable(true, PLA_Forecast_Model);
                }
                else
                {
                    //SetVisible(false, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                    PLA_Purchasing_Group.SelectedIndex = -1;
                    //SetForeColor(Color.Orange, PLA_Selection_Method_L);
                    //SetEnable(false, PLA_Selection_Method);
                    //PLA_Selection_Method.SelectedValue = "3";
                }
            }

            if (Category != "RAW" && Category != "PACK" && PLA_Storage_Location.Enabled && TaskAPI.Process != "P-Plant Extend Application")
            {
                if (FORM != "FORM-015")
                {
                    PLA_Storage_Location.Dialog_Parameter_Value = "{Plant:" + PLA_Plant.SelectedValue + "}";
                }
            }

            if (PLA_MRP_Controller.Enabled)
            {
                PLA_MRP_Controller.Dialog_Parameter_Value = "{Plant:" + PLA_Plant.SelectedValue + "}";
            }

            if (PLA_MRP_Group.Enabled && Category == "FINI")
            {
                PLA_MRP_Group.Dialog_Parameter_Value = "{Plant:" + PLA_Plant.SelectedValue + "}";
            }

            string TMPPLA_Special_Procurement = PLA_Special_Procurement.SelectedValue;
            PLA_Special_Procurement.Items.Clear();
            PLA_Special_Procurement.Items.Add(new ListItem("", ""));
            IList<m_SpecialProcurementType> sps = (m_SpecialProcurementType.status == 1
                & (m_SpecialProcurementType.procurement_type == PLA_Plant.SelectedValue
                 | m_SpecialProcurementType.procurement_type == "")).List<m_SpecialProcurementType>();

            foreach (m_SpecialProcurementType sp in sps)
            {
                PLA_Special_Procurement.Items.Add(new ListItem(sp.SPT + ", " + sp.Description, sp.SPT));
                if (TMPPLA_Special_Procurement == sp.SPT) PLA_Special_Procurement.SelectedValue = sp.SPT;
            }
            if (TaskAPI.Process == "PKG Fini Code BOM Application" && FORM == "FORM-031-2")
            {
                PLA_Special_Procurement.Items.Add(new ListItem("D1, K15D ICD stock transfer from plant K15P", "D1"));
            }
            if (TaskAPI.Process == "HK-NPL Pack Size Application" && FORM == "FORM-062")
            {
                PLA_Special_Procurement.Items.Add(new ListItem("DA, K18D ICD stock transfer from plant K15D", "DA"));
            }
            if (Category == "FINI" && FORM == "FORM-015")
            {
                SetVisible(false, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
            }
            if (TaskAPI.Process == "TW MTO Application-DECO" && FORM == "FORM-T006")
            {
                PLA_Special_Procurement.Items.Add(new ListItem("W1, ICD stock transfer from plant KT1P", "W1"));
            }
            if (TaskAPI.Process == "TW MTO Application-PKG" && FORM == "FORM-T010")
            {
                PLA_Special_Procurement.Items.Add(new ListItem("W2, ICD stock transfer from plant KT2P", "W2"));
            }
            if ((TaskAPI.Process == "MTO Base Code Application" && FORM == "FORM-012"))
            {
                PLA_Special_Procurement.Items.Add(new ListItem("F1,K29D ICD Stock transfer from plant K29P", "F1"));
                PLA_Special_Procurement.Items.Add(new ListItem("FA,ICD stock transfer from plant K29D", "FA"));
            }
        }
        #endregion

        #region Safty_Stock 文本发生改变事件
        protected void PLA_Safty_Stock_TextChanged(object sender, EventArgs e)
        {
            SetForeColor(Color.Black, PLA_Safety_Time_Ind_L, PLA_Safty_Stock_L, PLA_Safety_Time_Act_Cov_L);
            switch ((sender as Anthem.TextBox).ID)
            {
                case "PLA_Safety_Time_Ind":
                case "PLA_Safety_Time_Act_Cov":
                    if (!PLA_Safety_Time_Ind.ReadOnly && !PLA_Safety_Time_Act_Cov.ReadOnly)
                    {
                        if (!string.IsNullOrEmpty(PLA_Safety_Time_Ind.Text) || !string.IsNullOrEmpty(PLA_Safety_Time_Act_Cov.Text))
                        {
                            SetForeColor(Color.Blue, PLA_Safety_Time_Ind_L, PLA_Safety_Time_Act_Cov_L);
                            PLA_Safty_Stock.Text = "";
                        }
                    }
                    break;
                case "PLA_Safty_Stock":
                    if (!PLA_Safty_Stock.ReadOnly)
                    {
                        if (!string.IsNullOrEmpty(PLA_Safty_Stock.Text))
                        {
                            SetForeColor(Color.Blue, PLA_Safty_Stock_L);
                            PLA_Safety_Time_Ind.Text = "";
                            PLA_Safety_Time_Act_Cov.Text = "";
                        }
                    }
                    break;
            }
        }
        private void SetSaftyStock()
        {
            SetForeColor(Color.Black, PLA_Safety_Time_Ind_L, PLA_Safty_Stock_L, PLA_Safety_Time_Act_Cov_L);
            if (!PLA_Safty_Stock.ReadOnly && !string.IsNullOrEmpty(PLA_Safty_Stock.Text))
            {
                SetForeColor(Color.Blue, PLA_Safty_Stock_L);
                PLA_Safety_Time_Ind.Text = "";
                PLA_Safety_Time_Act_Cov.Text = "";
            }
            if ((!PLA_Safety_Time_Ind.ReadOnly && !string.IsNullOrEmpty(PLA_Safety_Time_Ind.Text)) || (!PLA_Safety_Time_Act_Cov.ReadOnly && !string.IsNullOrEmpty(PLA_Safety_Time_Act_Cov.Text)))
            {
                SetForeColor(Color.Blue, PLA_Safety_Time_Ind_L, PLA_Safety_Time_Act_Cov_L);
                PLA_Safty_Stock.Text = "";
            }

        }
        #endregion

        #region ICD
        protected void PLA_ICD_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (Category == "FINI")
                {
                    if (PLA_ICD.SelectedValue == "Y")
                    {
                        (Parent as TabMaterial).Finance1.FIN_Valuation_Class.Items.Clear();
                        (Parent as TabMaterial).Finance1.FIN_Valuation_Class.Items.Add(new ListItem("Z001", "Z001"));
                        (Parent as TabMaterial).Finance1.FIN_Valuation_Class.SelectedValue = "Z001";
                    }
                    else
                    {
                        (Parent as TabMaterial).Finance1.FIN_Valuation_Class.Items.Clear();
                        (Parent as TabMaterial).Finance1.FIN_Valuation_Class.Items.Add(new ListItem("7920", "7920"));
                        (Parent as TabMaterial).Finance1.FIN_Valuation_Class.SelectedValue = "7920";
                    }
                }
            }
            catch (Exception)
            {
            }
        }
        #endregion

        #region Planning Material
        protected void PLA_Planning_Material_TextChanged(object sender, EventArgs e)
        {
            string s = PLA_Planning_Material.Text + PLA_Planning_Plant.SelectedValue + PLA_Plng_Conv_Factor.Text + PLA_Planning_Matl_BUnit.Text;
            if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("D"))
            {
                if (string.IsNullOrEmpty(s) || (Page as PMDC).Actions.SelectedValue != "Creation")
                {
                    SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
                else
                {
                    SetForeColor(Color.Blue, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
            }
            if ((TaskAPI.Process == "NPL Master Data Application" || TaskAPI.Process == "P-Plant Extend Application" || TaskAPI.Process == "D-Plant Extend Application") && (FORM == "FORM-010" || FORM == "FORM-005"))
            {
                if (PLA_Strategy_Group.SelectedValue == "96")
                {
                    if (!string.IsNullOrEmpty(PLA_Planning_Material.Text))
                    {
                        PLA_Forecast_Model.SelectedValue = "0";
                    }

                    if (string.IsNullOrEmpty(PLA_Planning_Material.Text))
                    {
                        PLA_Forecast_Model.SelectedValue = "N";
                    }

                }
            }

        }
        #endregion

        #region Plng Conv Factor
        protected void PLA_Plng_Conv_Factor_TextChanged(object sender, EventArgs e)
        {
            string s = PLA_Planning_Material.Text + PLA_Planning_Plant.SelectedValue + PLA_Plng_Conv_Factor.Text + PLA_Planning_Matl_BUnit.Text;
            if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("D"))
            {
                if (string.IsNullOrEmpty(s) || (Page as PMDC).Actions.SelectedValue != "Creation")
                {
                    SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);

                }
                else
                {
                    PLA_Planning_Matl_BUnit.Text = "PC";
                    //SetForeColor(Color.Orange, PLA_Planning_Matl_BUnit_L);
                    //SetEnable(false, PLA_Planning_Matl_BUnit);
                    SetForeColor(Color.Blue, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
            }

        }
        #endregion

        #region Planning Matl BUnit
        protected void PLA_Planning_Matl_BUnit_TextChanged(object sender, EventArgs e)
        {
            string s = PLA_Planning_Material.Text + PLA_Planning_Plant.SelectedValue + PLA_Plng_Conv_Factor.Text + PLA_Planning_Matl_BUnit.Text;
            if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("D"))
            {
                if (string.IsNullOrEmpty(s) || (Page as PMDC).Actions.SelectedValue != "Creation")
                {
                    SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
                else
                {
                    SetForeColor(Color.Blue, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
            }

        }
        #endregion

        #region Planning Plant
        protected void PLA_Planning_Plant_SelectedIndexChanged(object sender, EventArgs e)
        {
            string s = PLA_Planning_Material.Text + PLA_Planning_Plant.SelectedValue + PLA_Plng_Conv_Factor.Text + PLA_Planning_Matl_BUnit.Text;
            if (PLA_Plant.SelectedValue.Length > 0 && PLA_Plant.SelectedValue.EndsWith("D"))
            {
                if (string.IsNullOrEmpty(s) || (Page as PMDC).Actions.SelectedValue != "Creation")
                {
                    SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
                else
                {
                    SetForeColor(Color.Blue, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                }
            }

        }
        #endregion

        #region Storage Location
        protected void PLA_Storage_Location_TextChanged(object sender, EventArgs e)
        {
            if (TaskAPI.Process == "TW Raw Code Application")
            {
                PLA_Prod_Stor_Loc.Text = PLA_Storage_Location.Text;
                PLA_Storage_Loc_For_EP.Text = PLA_Storage_Location.Text;
            }
        }
        #endregion

        #region 方法 InitControls(初始化)
        public void InitControls(mdc_Material mt)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            Visible = IsUsed;
            if (!IsUsed)
            {
                return;
            }

            InitShowHide();

            //if (!IsLoaded)
            // {
            InitDropDownList();
            // }

            Distribute(mt);

            SetForeColor(Color.Black, PLA_Special_Procurement_L, PLA_PO_Price_L, PLA_In_house_Production_Time_L, PLA_Availability_Check_L, PLA_Lot_Size_1_L, PLA_In_house_Production_Time_1_L, PLA_Plant_L, PLA_FINI_Material_Code_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_IsPurchase_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Valuation_Class_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_Is_MTS_MTO_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Deletion_Flag_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Purchasing_Group_L, PLA_In_house_Production_Time_L);
            SetForeColor(Color.Black, PLA_Special_Procurement1, PLA_Plant_1_L, PLA_Source_List_L, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1_L, PLA_MRP_Type_1_L, PLA_MRP_Controller_1_L, PLA_Lot_Size_1_L, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1_L, PLA_Period_Indicator_1_L, PLA_Selection_Method_1_L, PLA_Unlimited_1_L, PLA_Product_Scheduling_L);
            //工厂是上海的 默认为S 不可修改。
            //string please_Select = (Page as PMDC).Distribute.SelectedValue.ToString();
            //if (TaskAPI.Process == "MTO Base Code Application")
            //{
            //    (Parent as TabMaterial).Status.Planning = "S";
            //}


            if (TaskAPI.IsAllowSubmit)
            {

                switch (Action)
                {
                    case "C":
                        if (TaskAPI.Process == "TW NPL Application-DECO" && FORM == "FORM-TW-007")
                        {
                            if (TaskAPI.Step == "Planning")
                            {
                                SetEnable(true, PLA_Rounding_Value);
                            }
                        }
                        SetForeColor(Color.Black, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L);
                        SetEnable(true, PLA_Plant_1, PLA_Source_List, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type_1, PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type_1, PLA_In_house_Production_Time_1, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Availability_Check_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling, PLA_Unit_of_issue);
                        SetEnable(true, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Individual_Coll, PLA_MRP_Controller);
                        if (TaskAPI.Process == "MTO Base Code Application")
                        {
                            SetForeColor(Color.Black, PLA_Plant_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L
                                                     , PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L, PLA_Special_Procurement_L
                                                     , PLA_Availability_Check_L, PLA_With_Qty_Struture_L, PLA_Is_MTS_MTO_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Storage_Loc_For_EP_L);
                            SetEnable(true, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Procurement_Type
                                                     , PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Purchasing_Group, PLA_Strategy_Group, PLA_Special_Procurement
                                                     , PLA_Availability_Check, PLA_With_Qty_Struture, PLA_Is_MTS_MTO, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Storage_Loc_For_EP);
                            SetEnable(true, PLA_Plant_1, PLA_Source_List, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type_1, PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type_1, PLA_In_house_Production_Time_1, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Availability_Check_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling, PLA_Unit_of_issue);
                            SetEnable(true, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Individual_Coll, PLA_MRP_Controller);
                        }
                        if (TaskAPI.Process == "Sefi Code Application")
                        {
                            SetForeColor(Color.Black, PLA_Special_Procurement_L);
                            SetForeColor(Color.Blue, PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L
                                         , PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L
                                         , PLA_With_Qty_Struture_L, PLA_Individual_Coll_L);
                        }
                        else
                        {
                            SetForeColor(Color.Blue, PLA_Plant_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L
                                         , PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L, PLA_Special_Procurement_L
                                         , PLA_Availability_Check_L, PLA_With_Qty_Struture_L, PLA_Is_MTS_MTO_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Storage_Loc_For_EP_L);
                        }
                        SetForeColor(Color.Black, PLA_ABC_Indicator_L, PLA_In_house_Production_Time_L);
                        if (Category == "FINI")
                        {
                            if (FORM == "FORM-005")
                            {
                                if (TaskAPI.Process == "NPL Master Data Application")
                                {
                                    SetForeColor(Color.Black, PLA_Tot_repl_lead_time_L, PLA_Tot_repl_lead_time);
                                }
                            }
                            if (TaskAPI.Process == "MTO Base Code Application")
                            {
                                if (TaskAPI.Step == "Planning")
                                {
                                    SetEnable(true, PLA_ICD, PLA_Availability_Check, PLA_MRP_Group, PLA_MRP_Controller, PLA_Tot_repl_lead_time);
                                }
                                else
                                {
                                    SetEnable(false, PLA_ICD, PLA_Availability_Check, PLA_MRP_Group, PLA_MRP_Controller, PLA_Tot_repl_lead_time);
                                }
                                SetForeColor(Color.Black, PLA_ICD_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Controller_L, PLA_Tot_repl_lead_time_L);

                            }
                            else
                            {
                                SetForeColor(Color.Blue, PLA_ICD_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Controller_L);
                            }
                            SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Individual_Coll_L, PLA_Forecast_Model_L);
                            if (FORM == "FORM-077")
                            {
                                SetForeColor(Color.Black, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_Special_Procurement1_L);
                                SetForeColor(Color.Blue, PLA_Prod_Stor_Loc_L, PLA_Plant_Sp_Matl_Status_L, PLA_Selection_Method_L);
                            }
                            if (FORM == "FORM-012")
                            {
                                SetForeColor(Color.Blue, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Plant_Sp_Matl_Status_L, PLA_Forecast_Model_L);
                            }

                            if (FORM == "FORM-064")
                            {
                                //SetForeColor(Color.Blue, PLA_Rounding_Value_L, PLA_Planned_Delivery_Time_L);
                            }

                            if (FORM == "FORM-074")
                            {
                                SetForeColor(Color.Blue, PLA_Plant_Sp_Matl_Status_L);
                            }

                            //if (FORM == "FORM-031" && (Parent as TabMaterial).Status.KeyWord == "MM1")
                            //{
                            //    SetForeColor(Color.Black, PLA_Storage_Loc_For_EP_L);
                            //}

                            if (FORM == "FORM-067")
                            {
                                SetForeColor(Color.Blue, PLA_Planned_Delivery_Time_L, PLA_Special_Procurement_L);
                            }
                            if (FORM == "FORM-031-1")
                            {
                                SetForeColor(Color.Blue, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_With_Qty_Struture_L);

                            }
                            if (FORM == "FORM-031-2")
                            {
                                SetForeColor(Color.Blue, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_With_Qty_Struture_L, PLA_MRP_Type_L);

                            }
                            if (FORM == "FORM-031-2")
                            {
                                SetForeColor(Color.Blue, PLA_Plant_L);
                            }
                            if (FORM == "FORM-010")
                            {
                                if (TaskAPI.Process == "D-Plant Extend Application")
                                {
                                    SetForeColor(Color.Blue, PLA_Special_Procurement_L);
                                }
                                SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L);
                                SetForeColor(Color.Black, PLA_Tot_repl_lead_time_L);
                            }
                            if (FORM == "FORM-062")
                            {
                                SetForeColor(Color.Blue, PLA_Strategy_Group_L);
                            }
                            if (FORM == "FORM-T009")
                            {
                                SetForeColor(Color.Blue, PLA_Planned_Delivery_Time_L);
                            }
                            if (FORM == "FORM-T006")
                            {
                                SetForeColor(Color.Blue, PLA_In_house_Production_Time_1_L);
                            }
                            if (FORM == "FORM-T010")
                            {
                                SetForeColor(Color.Blue, PLA_In_house_Production_Time_1_L, PLA_MRP_Type_L, PLA_Availability_Check_1_L);
                            }
                            if (FORM == "FORM-TW-011")
                            {
                                SetForeColor(Color.Black, PLA_MRP_Controller_L, PLA_Strategy_Group_L);
                                SetForeColor(Color.Blue, PLA_Lot_Size_L, PLA_In_house_Production_Time_L, PLA_MRP_Type_L, PLA_Availability_Check_L);
                            }
                            if (FORM == "FORM-TW-010")
                            {
                                SetForeColor(Color.Black, PLA_MRP_Controller_L, PLA_Availability_Check_L, PLA_Strategy_Group_L);
                                SetForeColor(Color.Blue, PLA_MRP_Type_1_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Lot_Size_1_L, PLA_In_house_Production_Time_1_L);
                                SetForeColor(Color.Black, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L);
                            }
                            if (FORM == "FORM-TW-007")
                            {
                                SetForeColor(Color.Black, PLA_In_house_Production_Time_L, PLA_MRP_Controller_L, PLA_MRP_Group_L, PLA_Storage_Loc_For_EP_L, PLA_Storage_Location_L, PLA_Strategy_Group_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L);
                                SetForeColor(Color.Black, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L);

                            }
                            if (FORM == "FORM-TW-007-1")
                            {
                                SetForeColor(Color.Black, PLA_MRP_Controller_L);
                                SetForeColor(Color.Blue, PLA_In_house_Production_Time_L, PLA_MRP_Type_L);

                            }
                            if (FORM == "FORM-TW-004")
                            {
                                //SetForeColor(Color.Black, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Strategy_Group_L);
                                SetForeColor(Color.Blue, PLA_PO_Price_L, PLA_ABC_Indicator_L, PLA_Planned_Delivery_Time_L);
                            }
                            if (FORM == "FORM-T003")
                            {
                                SetForeColor(Color.Blue, PLA_Storage_Location_L, PLA_ABC_Indicator_L, PLA_Special_Procurement_L, PLA_Planned_Delivery_Time_L, PLA_PO_Price_L);
                            }
                            if (FORM == "FORM-T018" && (Page as PMDC).rd_Raw_Code.SelectedIndex.ToString() == "1")
                            {
                                SetForeColor(Color.Blue, PLA_Storage_Location_L, PLA_Plant_L);
                            }
                        }

                        if (Category == "SEFI")
                        {
                            if (Category == "SEFI" && FORM == "FORM-035")
                            {
                                SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                            }
                            SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Storage_Loc_For_EP_L);
                            if (TaskAPI.Process == "MTO Base Code Application")
                            {
                                if (TaskAPI.Step == "Planning")
                                {
                                    SetEnable(true, PLA_MRP_Controller);
                                }
                                else
                                {
                                    SetEnable(false, PLA_MRP_Controller);
                                }
                                SetForeColor(Color.Black, PLA_MRP_Controller_L);

                            }
                            else
                            {
                                SetForeColor(Color.Blue, PLA_MRP_Controller_L);
                            }

                            if (FORM == "FORM-077")
                            {
                                SetForeColor(Color.Black, PLA_Purchasing_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_Special_Procurement_L);
                                SetForeColor(Color.Blue, PLA_Plant_Sp_Matl_Status_L);

                            }
                            if (FORM == "FORM-012")
                            {
                                SetForeColor(Color.Black, PLA_Purchasing_Group_L);
                            }
                        }
                        if ((FORM == "FORM-012" && TaskAPI.Process == "MTO Base Code Application"))
                        {
                            SetForeColor(Color.Black, PLA_Special_Procurement_L, PLA_In_house_Production_Time_L);
                        }
                        if (FORM == "FORM-T008" && TaskAPI.Process == "TW MTO Application-DECO")
                        {
                            SetForeColor(Color.Blue, PLA_Lot_Size_L, PLA_In_house_Production_Time_L, PLA_Availability_Check_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Procurement_Type_L);
                        }
                        if (FORM == "FORM-T011" && TaskAPI.Process == "TW MTO Application-PKG")
                        {
                            SetForeColor(Color.Blue, PLA_Lot_Size_L, PLA_In_house_Production_Time_L, PLA_Availability_Check_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Procurement_Type_L);
                        }
                        if (FORM == "FORM-T007" && TaskAPI.Process == "TW SEFI Code Application")
                        {
                            SetForeColor(Color.Blue, PLA_Backflush_L, PLA_Lot_Size_L, PLA_In_house_Production_Time_L, PLA_Availability_Check_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                        }
                        if (FORM == "FORM-T011-1" && TaskAPI.Process == "TW SEFI Code Application")
                        {
                            SetForeColor(Color.Blue, PLA_Backflush_L, PLA_Lot_Size_L, PLA_In_house_Production_Time_L, PLA_Availability_Check_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Safety_Stock_Method_L, PLA_SNP_Planner_L, PLA_Production_Planner_L);
                        }
                        if (Category == "PACK")
                        {
                            if (FORM == "FORM-043")
                            {
                                SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L, PLA_MRP_Controller_L, PLA_Prod_Stor_Loc_L);
                                SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                            }

                            SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                        }

                        if (Category == "RAW")
                        {
                            SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_Prod_Stor_Loc_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                        }
                        SetDefaultValue();
                        break;
                    case "S":
                        SetEnable(false, PLA_Special_Procurement1, PLA_PO_Price, PLA_Plant_1, PLA_Source_List, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type_1, PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type_1, PLA_In_house_Production_Time_1, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Availability_Check_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling, PLA_Tot_repl_lead_time);
                        SetEnable(false, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Strategy_Group, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Individual_Coll, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Minimum_Lot_Size, PLA_Unit_of_issue);
                        if (FORM == "FORM-T006" && TaskAPI.IsAllowSubmit)
                        {
                            SetEnable(true, PLA_Rounding_Value);
                        }
                        if (FORM == "FORM-015" && TaskAPI.IsBeginStep)
                        {
                            SetEnable(true, PLA_Plant);
                        }
                        SetDefaultValue();
                        SetForeColor(Color.Black, PLA_Safety_Stock_Method_L, PLA_SNP_Planner_L, PLA_Production_Planner_L, PLA_ABC_Indicator_L, PLA_In_house_Production_Time_L, PLA_Special_Procurement1_L);
                        SetForeColor(Color.Black, PLA_Plant_1_L, PLA_Source_List_L, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1_L, PLA_MRP_Type_1_L, PLA_MRP_Controller_1_L, PLA_Lot_Size_1_L, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1_L, PLA_Period_Indicator_1_L, PLA_Selection_Method_1_L, PLA_Unlimited_1_L, PLA_Product_Scheduling_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                        SetForeColor(Color.Black, PLA_In_house_Production_Time_L, PLA_Availability_Check_L, PLA_Lot_Size_1_L, PLA_In_house_Production_Time_1_L, PLA_Plant_L, PLA_FINI_Material_Code_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_IsPurchase_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Valuation_Class_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_Is_MTS_MTO_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Deletion_Flag_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Purchasing_Group_L, PLA_In_house_Production_Time_L);


                        break;
                    case "E":
                        SetEnable(true, PLA_PO_Price, PLA_Plant_1, PLA_Source_List, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type_1, PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type_1, PLA_In_house_Production_Time_1, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Availability_Check_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling);
                        SetEnable(true, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Unit_of_issue);
                        SetForeColor(Color.Black, PLA_Plant_1_L, PLA_Source_List_L, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1_L, PLA_MRP_Type_1_L, PLA_MRP_Controller_1_L, PLA_Lot_Size_1_L, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1_L, PLA_Period_Indicator_1_L, PLA_Selection_Method_1_L, PLA_Unlimited_1_L, PLA_Product_Scheduling_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                        SetForeColor(Color.Black, PLA_In_house_Production_Time_L, PLA_Availability_Check_L, PLA_Lot_Size_1_L, PLA_In_house_Production_Time_1_L, PLA_FINI_Material_Code_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_IsPurchase_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Valuation_Class_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_Is_MTS_MTO_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Deletion_Flag_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L);
                        SetForeColor(Color.Black, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L);
                        if (TaskAPI.Process != "TW FINI Code Application")
                        {
                            SetForeColor(Color.Blue, PLA_Plant_L);
                        }
                        SetDefaultValue();
                        break;
                }
            }
            else
            {
                SetForeColor(Color.Black, PLA_Safty_Stock_L, PLA_Special_Procurement_L, PLA_Special_Procurement1_L);
                SetEnable(false, PLA_PO_Price, PLA_Source_List, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Strategy_Group, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Forecast_Model);
                SetEnable(false, PLA_Special_Procurement1, PLA_Plant_1, PLA_Source_List, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type_1, PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type_1, PLA_In_house_Production_Time_1, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Availability_Check_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling);

            }



            SetNPLPlant("");
        }
        #endregion

        #region 方法 InitDropdownList(初始化下拉框数据源)
        private void InitDropDownList()
        {
            PLA_Plant.Items.Clear();
            PLA_Plant.Items.Add(new ListItem("", ""));
            PLA_Planning_Plant.Items.Clear();
            PLA_Planning_Plant.Items.Add(new ListItem("", ""));

            IList<m_Plant> dlts;
            if (Category == "FINI")
            {
                dlts = (m_Plant.status == 1).List<m_Plant>();
            }
            else
            {
                dlts = (m_Plant.status == 1 & m_Plant.categary == "P").List<m_Plant>();
            }
            foreach (m_Plant dlt in dlts)
            {
                PLA_Plant.Items.Add(new ListItem(dlt.PlantName, dlt.PlantName));
                PLA_Planning_Plant.Items.Add(new ListItem(dlt.PlantName, dlt.PlantName));
            }

            PLA_Purchasing_Group.Items.Clear();
            PLA_Purchasing_Group.Items.Add(new ListItem("", ""));
            IList<m_PurchasingGroup> pgs = (m_PurchasingGroup.status == 1).List<m_PurchasingGroup>();
            foreach (m_PurchasingGroup pg in pgs)
            {
                PLA_Purchasing_Group.Items.Add(new ListItem(pg.Purchase_Group + ", " + pg.Description, pg.Purchase_Group));
            }

            //PLA_Special_Procurement.Items.Clear();
            //PLA_Special_Procurement.Items.Add(new ListItem("", ""));
            //IList<m_SpecialProcurementType> sps = (m_SpecialProcurementType.status == 1).List<m_SpecialProcurementType>();
            //foreach (m_SpecialProcurementType sp in sps)
            //{
            //    PLA_Special_Procurement.Items.Add(new ListItem(sp.SPT + ", " + sp.Source_Plant, sp.SPT));
            //}

            PLA_Plant_Sp_Matl_Status.Items.Clear();
            PLA_Plant_Sp_Matl_Status.Items.Add(new ListItem("", ""));
            IList<m_PlantSpMatlStatus> psmss = (m_PlantSpMatlStatus.status == 1).List<m_PlantSpMatlStatus>();
            foreach (m_PlantSpMatlStatus psms in psmss)
            {
                PLA_Plant_Sp_Matl_Status.Items.Add(new ListItem(psms.Plant_Sp_Matl_Status + ", " + psms.Description, psms.Plant_Sp_Matl_Status));
            }

            if (TaskAPI.Process == "TW FINI Code Application" || TaskAPI.Process == "TW Trade Code Application-PKG" || TaskAPI.Process == "TW Pack Material Maintenance" || TaskAPI.Process == "TW NPL Application-PKG" || TaskAPI.Process == "TW NPL Application-DECO" || TaskAPI.Process == "TW Raw Code Application" || TaskAPI.Process == "TW SEFI Code Application")
            {
                PLA_Plant.Items.Clear();
                PLA_Plant.Items.Add(new ListItem("", ""));
                if (FORM == "FORM-TW-004" || FORM == "FORM-TW-007-1" || FORM == "FORM-T003")
                {
                    PLA_Plant.Items.Add(new ListItem("KT1P", "KT1P"));
                    PLA_Plant.Items.Add(new ListItem("KT2P", "KT2P"));
                }
                else if (FORM == "FORM-TW-007")
                {
                    PLA_Plant.Items.Add(new ListItem("KT1P", "KT1P"));
                    PLA_Plant.Items.Add(new ListItem("KT1D", "KT1D"));
                }
                else if (FORM == "FORM-T018")
                {
                    PLA_Plant.Items.Add(new ListItem("KT1D", "KT1D"));
                    PLA_Plant.Items.Add(new ListItem("KT2D", "KT2D"));
                }
                else if (FORM == "FORM-T007")
                {
                    PLA_Plant.Items.Add(new ListItem("KT1P", "KT1P"));
                }
                else if (FORM == "FORM-T011-1")
                {
                    PLA_Plant.Items.Add(new ListItem("KT2P", "KT2P"));
                }
                else
                {
                    PLA_Plant.Items.Add(new ListItem("KT2D", "KT2D"));
                    PLA_Plant.Items.Add(new ListItem("KT2P", "KT2P"));
                }

                PLA_Plant_1.Items.Clear();
                PLA_Plant_1.Items.Add(new ListItem("KT2D", "KT2D"));
                PLA_Plant_1.Items.Add(new ListItem("KT2P", "KT2P"));
                if (FORM != "FORM-TW-007-1" && FORM != "FORM-TW-004" && FORM != "FORM-T012")
                {
                    PLA_Special_Procurement.Items.Clear();
                    PLA_Special_Procurement.Items.Add(new ListItem("", ""));
                    PLA_Special_Procurement.Items.Add(new ListItem("W2", "W2"));
                }
                if (FORM == "FORM-TW-007")
                {
                    PLA_Special_Procurement.Items.Clear();
                    PLA_Special_Procurement.Items.Add(new ListItem("", ""));
                    PLA_Special_Procurement.Items.Add(new ListItem("W1", "W1"));
                }
                PLA_Plant_Sp_Matl_Status_1.Items.Clear();
                PLA_Plant_Sp_Matl_Status_1.Items.Add(new ListItem("", ""));
                PLA_Plant_Sp_Matl_Status_1.Items.Add(new ListItem("ZG", "ZG"));
            }
            if (TaskAPI.Process == "TW MTO Application-DECO" || TaskAPI.Process == "TW MTO Application-PKG")
            {
                PLA_Plant.Items.Clear();
                PLA_Plant.Items.Add(new ListItem("", ""));
                if (FORM == "FORM-T006")
                {
                    PLA_Plant_1.Items.Add(new ListItem("KT1P", "KT1P"));
                    PLA_Plant.Items.Add(new ListItem("KT1D", "KT1D"));
                }
                if (FORM == "FORM-T008" || FORM == "FORM-T007")
                {
                    PLA_Plant.Items.Add(new ListItem("KT1P", "KT1P"));
                }
                if (FORM == "FORM-T011")
                {
                    PLA_Plant.Items.Add(new ListItem("KT2P", "KT2P"));
                }
                if (FORM == "FORM-T010")
                {
                    PLA_Plant_1.Items.Add(new ListItem("KT2P", "KT2P"));
                    PLA_Plant.Items.Add(new ListItem("KT2D", "KT2D"));
                    PLA_Special_Procurement.Items.Clear();
                    PLA_Special_Procurement.Items.Add(new ListItem("", ""));
                    PLA_Special_Procurement.Items.Add(new ListItem("W2", "W2"));
                }
                //PLA_Special_Procurement.Items.Clear();
                //PLA_Special_Procurement.Items.Add(new ListItem("", ""));
                //PLA_Special_Procurement.Items.Add(new ListItem("W1, ICD stock transfer from plant KT1P", "W1"));
                PLA_Plant_Sp_Matl_Status_1.Items.Clear();
                PLA_Plant_Sp_Matl_Status_1.Items.Add(new ListItem("", ""));
                PLA_Plant_Sp_Matl_Status_1.Items.Add(new ListItem("ZG", "ZG"));
            }
        }
        #endregion

        #region 方法 InitShowHide(初始化控件显示)
        private void InitShowHide()
        {
            #region 设置禁启用
            SetVisible(false, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_FINI_Material_Code, PLA_Storage_Loc_For_EP, PLA_Strategy_Group
                            , PLA_Plant_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_IsPurchase_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Valuation_Class_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_Is_MTS_MTO_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Consumption_Mode_L, PLA_Deletion_Flag_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2, PLA_Overdely_Tol_L2, PLA_FINI_Material_Code_L, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Unit_of_issue, PLA_Unit_of_issue_L);
            SetVisible(false, PLA_PO_Price, PLA_PO_Price_L, PLA_Plant_1, PLA_Plant_1_L, PLA_Source_List_L, PLA_Source_List, PLA_Storage_Location_1, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1, PLA_MRP_Group_1_L, PLA_MRP_Type_1, PLA_MRP_Type_1_L, PLA_MRP_Controller_1, PLA_MRP_Controller_1_L, PLA_Lot_Size_1, PLA_Lot_Size_1_L, PLA_Storage_Loc_For_EP_1, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1, PLA_Availability_Check_1_L, PLA_Period_Indicator_1, PLA_Period_Indicator_1_L, PLA_Selection_Method_1, PLA_Selection_Method_1_L, PLA_Unlimited_1_L, PLA_Unlimited_1, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
            SetVisible(false, PLA_Production_Planner_L, PLA_Production_Planner, PLA_SNP_Planner_L, PLA_SNP_Planner, PLA_Safety_Stock_Method_L, PLA_Safety_Stock_Method, PLA_Special_Procurement1_L, PLA_Special_Procurement1, PLA_Tot_repl_lead_time_L, PLA_Tot_repl_lead_time);
            switch (FORM)
            {
                case "FORM-001":
                    SetVisible(true, PLA_With_Qty_Struture, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_With_Qty_Struture_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L);
                    break;

                case "FORM-002":
                    SetVisible(true, PLA_Individual_Coll, PLA_Plant, PLA_Storage_Location, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Fix_Lot_Size, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_With_Qty_Struture, PLA_ABC_Indicator, PLA_Backflush, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Plant_Sp_Matl_Status, PLA_Storage_Loc_For_EP
                                   , PLA_Individual_Coll_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Fix_Lot_Size_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_With_Qty_Struture_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2, PLA_Plant_Sp_Matl_Status_L, PLA_Storage_Loc_For_EP_L);
                    break;
                case "FORM-005":
                    SetVisible(true, PLA_Individual_Coll, PLA_Plant, PLA_Storage_Location, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_With_Qty_Struture, PLA_Plant_Sp_Matl_Status, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Storage_Loc_For_EP, PLA_Overdely_Tol, PLA_Do_Not_Cost
                                   , PLA_Individual_Coll_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_With_Qty_Struture_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Deletion_Flag_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_Storage_Loc_For_EP_L, PLA_Overdely_Tol_L, PLA_Overdely_Tol_L2);
                    if (Category == "FINI")
                    {
                        SetVisible(TaskAPI.Process == "NPL Master Data Application", PLA_Tot_repl_lead_time_L, PLA_Tot_repl_lead_time);
                        SetVisible(true, PLA_ICD, PLA_ICD_L, PLA_ABC_Indicator, PLA_ABC_Indicator_L, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                    }
                    break;
                case "FORM-009":
                    SetVisible(true, PLA_Storage_Location, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Procurement_Type, PLA_Prod_Stor_Loc, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Plant_Sp_Matl_Status, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Plant, PLA_Storage_Loc_For_EP
                                   , PLA_Storage_Location_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Plant_Sp_Matl_Status_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2, PLA_Plant_L, PLA_Storage_Loc_For_EP_L);

                    SetVisible(TaskAPI.Process != "New Raw Material Introducing", PLA_Plant, PLA_Plant_L);
                    break;
                case "FORM-010":
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_ABC_Indicator, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Deletion_Flag, PLA_Strategy_Group, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Storage_Loc_For_EP
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_IsPurchase_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_ABC_Indicator_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Deletion_Flag_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2, PLA_Overdely_Tol_L2, PLA_Strategy_Group_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_Storage_Loc_For_EP_L
                                   , PLA_Tot_repl_lead_time_L, PLA_Tot_repl_lead_time);
                    break;
                case "FORM-012":
                case "FORM-077":
                    if (Category == "SEFI")
                    {
                        SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_MRP_Group, PLA_MRP_Type, PLA_ABC_Indicator, PLA_MRP_Controller, PLA_Plant_Sp_Matl_Status, PLA_Lot_Size, PLA_IsPurchase, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_In_house_Production_Time, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Planning_Material, PLA_Safety_Time_Ind, PLA_Plant, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_Planning_Plant, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit
                                       , PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_MRP_Controller_L, PLA_Plant_Sp_Matl_Status_L, PLA_Lot_Size_L, PLA_IsPurchase_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Planning_Material_L, PLA_Safety_Time_Ind_L, PLA_Plant_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_Purchasing_Group_L, PLA_Purchasing_Group);

                        if (TaskAPI.Process == "MTO Base Code Application")
                        {
                            SetVisible(true, PLA_Special_Procurement1_L, PLA_Special_Procurement1);
                            SetVisible(false, PLA_Special_Procurement_L, PLA_Special_Procurement);
                        }
                        else
                        {
                            SetVisible(true, PLA_Special_Procurement_L, PLA_Special_Procurement);
                        }
                    }

                    if (Category == "FINI")
                    {
                        if (TaskAPI.Process == "MTO Template Data Collection" && TaskAPI.Step == "Logistic")
                        {
                            SetVisible(false, PLA_Storage_Location, PLA_Storage_Location_L);
                        }
                        else
                        {
                            SetVisible(true, PLA_Storage_Location, PLA_Storage_Location_L);
                        }
                        if (TaskAPI.Process == "MTO Base Code Application")
                        {
                            SetVisible(true, PLA_Special_Procurement1_L, PLA_Special_Procurement1);
                            SetVisible(false, PLA_Special_Procurement_L, PLA_Special_Procurement);
                            SetVisible(true, PLA_Tot_repl_lead_time_L, PLA_Tot_repl_lead_time);
                        }
                        else
                        {
                            SetVisible(true, PLA_Special_Procurement_L, PLA_Special_Procurement);
                        }
                        SetVisible(true, PLA_Plant, PLA_MRP_Group, PLA_MRP_Type, PLA_ABC_Indicator, PLA_MRP_Controller, PLA_Plant_Sp_Matl_Status, PLA_Lot_Size, PLA_IsPurchase, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_In_house_Production_Time, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Planning_Material, PLA_Safety_Time_Ind, PLA_Plant, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_ICD, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Forecast_Model, PLA_Planning_Plant, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Purchasing_Group, PLA_Strategy_Group
                                       , PLA_Plant_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_MRP_Controller_L, PLA_Plant_Sp_Matl_Status_L, PLA_Lot_Size_L, PLA_IsPurchase_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Planning_Material_L, PLA_Safety_Time_Ind_L, PLA_Plant_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_ICD_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Forecast_Model_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L, PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L);
                    }
                    break;
                case "FORM-062-1":
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_MRP_Group, PLA_MRP_Type, PLA_ABC_Indicator, PLA_MRP_Controller, PLA_Plant_Sp_Matl_Status, PLA_Lot_Size, PLA_IsPurchase, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_In_house_Production_Time, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Planning_Material, PLA_Safety_Time_Ind, PLA_Plant, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_ICD, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Forecast_Model, PLA_Planning_Plant, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Purchasing_Group, PLA_Strategy_Group
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_MRP_Controller_L, PLA_Plant_Sp_Matl_Status_L, PLA_Lot_Size_L, PLA_IsPurchase_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Planning_Material_L, PLA_Safety_Time_Ind_L, PLA_Plant_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_ICD_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Forecast_Model_L, PLA_Planning_Plant_L, PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L, PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L);

                    break;
                case "FORM-074":
                    if (Category == "SEFI")
                    {
                        SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_MRP_Group, PLA_MRP_Type, PLA_ABC_Indicator, PLA_MRP_Controller, PLA_Plant_Sp_Matl_Status, PLA_Lot_Size, PLA_IsPurchase, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_In_house_Production_Time, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Planning_Material, PLA_Safety_Time_Ind, PLA_Plant, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_Planning_Plant, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit
                                       , PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_MRP_Controller_L,
                                       PLA_Plant_Sp_Matl_Status_L, PLA_Lot_Size_L, PLA_IsPurchase_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L,
                                       PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L,
                                       PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L,
                                       PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L,
                                       PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Planning_Material_L, PLA_Safety_Time_Ind_L, PLA_Plant_L,
                                       PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_Planning_Plant_L,
                                       PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L);
                    }

                    if (Category == "FINI")
                    {
                        PLA_Title.Text = "&nbsp;";

                        SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_MRP_Group, PLA_MRP_Type, PLA_ABC_Indicator, PLA_MRP_Controller, PLA_Plant_Sp_Matl_Status, PLA_Lot_Size, PLA_IsPurchase, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_In_house_Production_Time, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Planning_Material, PLA_Safety_Time_Ind, PLA_Plant, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_ICD, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Forecast_Model, PLA_Planning_Plant, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Purchasing_Group, PLA_Strategy_Group
                                       , PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_MRP_Controller_L,
                                       PLA_Plant_Sp_Matl_Status_L, PLA_Lot_Size_L, PLA_IsPurchase_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L,
                                       PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L,
                                       PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L,
                                       PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L,
                                       PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Planning_Material_L, PLA_Safety_Time_Ind_L, PLA_Plant_L,
                                       PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_ICD_L,
                                       PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Forecast_Model_L, PLA_Planning_Plant_L,
                                       PLA_Plng_Conv_Factor_L, PLA_Planning_Matl_BUnit_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L,
                                       PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Safty_Stock,
                                       PLA_Safty_Stock_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L, PLA_Safety_Time_Act_Cov_L2, PLA_Planned_Delivery_Time_L2,
                                       PLA_In_house_Production_Time_L2, PLA_GR_Processing_Time_L2, PLA_Forecast_Model, PLA_Forecast_Model_L);

                        SetVisible(false, PLA_ICD, PLA_ICD_L, PLA_IsPurchase, PLA_IsPurchase_L, PLA_Unlimited, PLA_Unlimited_L, PLA_Overdely_Tol, PLA_Overdely_Tol_L, PLA_Planning_Matl_BUnit, PLA_Planning_Matl_BUnit_L, PLA_Planning_Material, PLA_Planning_Material_L, PLA_Plng_Conv_Factor, PLA_Plng_Conv_Factor_L, PLA_Planning_Plant, PLA_Planning_Plant_L);
                    }
                    break;

                case "FORM-062":
                    //if (FORM == "FORM-062")     //Form-062 HK Fini code  NPL V2.0 100925 && Form-064 HK Trade Code V2.0 100925.xls
                    //{

                    //}
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_MRP_Group, PLA_MRP_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_With_Qty_Struture, PLA_With_Qty_Struture_L
                                   , PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_ABC_Indicator, PLA_ABC_Indicator_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L
                                   , PLA_Rounding_Value, PLA_Rounding_Value_L, PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L2
                                   , PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time_L2
                                   , PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L, PLA_Safty_Stock, PLA_Safty_Stock_L
                                   , PLA_Period_Indicator, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Special_Procurement, PLA_Special_Procurement_L
                                   , PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_Consumption_Mode, PLA_Consumption_Mode_L
                                   , PLA_Selection_Method, PLA_Selection_Method_L, PLA_Bwd_Comsumption, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption, PLA_Fwd_Comsumption_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L
                                   , PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Individual_Coll, PLA_Individual_Coll_L);
                    break;

                case "FORM-064":

                    SetVisible(false, this.PLA_ICD, this.PLA_ICD_L, this.PLA_IsPurchase, this.PLA_IsPurchase_L, this.PLA_Fix_Lot_Size, this.PLA_Fix_Lot_Size_L,
                        this.PLA_Unlimited, this.PLA_Unlimited_L, this.PLA_Overdely_Tol, this.PLA_Overdely_Tol_L, this.PLA_Overdely_Tol_L2, PLA_With_Qty_Struture,
                        PLA_With_Qty_Struture_L, this.PLA_Forecast_Model, this.PLA_Forecast_Model_L, this.PLA_Individual_Coll, this.PLA_Individual_Coll_L, this.PLA_Planning_Material, this.PLA_Planning_Material_L,
                       this.PLA_Planning_Plant, this.PLA_Planning_Plant_L, this.PLA_Selection_Method, this.PLA_Selection_Method_L, this.PLA_Do_Not_Cost, this.PLA_Do_Not_Cost_L,
                       PLA_Valuation_Class, PLA_Valuation_Class_L
                       );

                    SetVisible(true, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_ABC_Indicator,
                                     PLA_ABC_Indicator_L, PLA_Stock_Det_Grp, PLA_Stock_Det_Grp_L);
                    break;

                case "FORM-065-1":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_GR_Processing_Time, PLA_GR_Processing_Time_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Plant_Sp_Matl_Status,
                                     PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L);

                    break;

                case "FORM-035":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_MRP_Group, PLA_MRP_Type, PLA_ABC_Indicator, PLA_MRP_Controller, PLA_Plant_Sp_Matl_Status, PLA_Lot_Size, PLA_IsPurchase, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_Unlimited
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_MRP_Controller_L, PLA_Plant_Sp_Matl_Status_L, PLA_Lot_Size_L, PLA_IsPurchase_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Overdely_Tol_L2, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_Unlimited_L, PLA_Rounding_Value_L);
                    break;
                case "FORM-036":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Storage_Location, PLA_Procurement_Type, PLA_Lot_Size, PLA_MRP_Controller, PLA_MRP_Type, PLA_ABC_Indicator, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_GR_Processing_Time, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_Safety_Time_Act_Cov, PLA_With_Qty_Struture, PLA_Backflush, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Availability_Check, PLA_Individual_Coll, PLA_Plant_Sp_Matl_Status, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Fix_Lot_Size, PLA_Planned_Delivery_Time, PLA_Rounding_Value
                                   , PLA_Storage_Location_L, PLA_Procurement_Type_L, PLA_Lot_Size_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_GR_Processing_Time_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_Safety_Time_Act_Cov_L, PLA_With_Qty_Struture_L, PLA_Backflush_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Individual_Coll_L, PLA_Plant_Sp_Matl_Status_L, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Fix_Lot_Size_L, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_Rounding_Value_L);
                    break;
                case "FORM-043":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Lot_Size, PLA_MRP_Controller, PLA_MRP_Type, PLA_ABC_Indicator, PLA_Fix_Lot_Size, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safty_Stock, PLA_With_Qty_Struture, PLA_Safety_Time_Ind, PLA_Safety_Time_Act_Cov, PLA_Backflush, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Availability_Check, PLA_Individual_Coll, PLA_Plant_Sp_Matl_Status
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Lot_Size_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_ABC_Indicator_L, PLA_Fix_Lot_Size_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time_L2, PLA_Safty_Stock_L, PLA_With_Qty_Struture_L, PLA_Safety_Time_Ind_L, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2, PLA_Backflush_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Individual_Coll_L, PLA_Plant_Sp_Matl_Status_L);
                    break;
                case "FORM-031-1":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller, PLA_Overdely_Tol, PLA_Unlimited, PLA_Lot_Size, PLA_With_Qty_Struture, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_ABC_Indicator, PLA_Fix_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Ind, PLA_Safty_Stock, PLA_Period_Indicator, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_Consumption_Mode, PLA_Selection_Method, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_SchedMargin_Key, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant
                                       , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Overdely_Tol_L, PLA_Overdely_Tol_L2, PLA_Unlimited_L, PLA_Lot_Size_L, PLA_With_Qty_Struture_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_ABC_Indicator_L, PLA_Fix_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2, PLA_Safety_Time_Ind_L, PLA_Safty_Stock_L, PLA_Period_Indicator_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_Consumption_Mode_L, PLA_Selection_Method_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_SchedMargin_Key_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L);
                    SetVisible(false, PLA_Purchasing_Group, PLA_Purchasing_Group_L);
                    break;

                case "FORM-031-2":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller, PLA_Overdely_Tol, PLA_Unlimited, PLA_Lot_Size, PLA_With_Qty_Struture, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_ABC_Indicator, PLA_Fix_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Ind, PLA_Safty_Stock, PLA_Period_Indicator, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_Consumption_Mode, PLA_Selection_Method, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Purchasing_Group, PLA_Forecast_Model, PLA_Strategy_Group, PLA_Plant_Sp_Matl_Status, PLA_SchedMargin_Key, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Overdely_Tol_L, PLA_Overdely_Tol_L2, PLA_Unlimited_L, PLA_Lot_Size_L, PLA_With_Qty_Struture_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_ABC_Indicator_L, PLA_Fix_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2, PLA_Safety_Time_Ind_L, PLA_Safty_Stock_L, PLA_Period_Indicator_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_Consumption_Mode_L, PLA_Selection_Method_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Purchasing_Group_L, PLA_Forecast_Model_L, PLA_Strategy_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_SchedMargin_Key_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L);
                    break;
                case "FORM-014":
                    SetVisible(true, PLA_GR_Processing_Time, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time_L2, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L, PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L);
                    break;
                case "FORM-067":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Type, PLA_MRP_Group, PLA_MRP_Controller, PLA_Lot_Size, PLA_With_Qty_Struture, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_ABC_Indicator, PLA_Fix_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Ind, PLA_Safty_Stock, PLA_Period_Indicator, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_Prod_Stor_Loc, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Purchasing_Group, PLA_Strategy_Group, PLA_Plant_Sp_Matl_Status, PLA_SchedMargin_Key
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Type_L, PLA_MRP_Group_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_With_Qty_Struture_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_ABC_Indicator_L, PLA_Fix_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Ind_L, PLA_Safty_Stock_L, PLA_Period_Indicator_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_Prod_Stor_Loc_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Purchasing_Group_L, PLA_Strategy_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_SchedMargin_Key_L, PLA_In_house_Production_Time_L2, PLA_Planned_Delivery_Time_L2, PLA_GR_Processing_Time_L2, PLA_Safety_Time_Act_Cov_L2);
                    break;
                case "FORM-015":
                    PLA_Title.Text = "&nbsp;";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L);
                    break;
                case "FORM-T009":
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L
                                   , PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group, PLA_MRP_Group_L, PLA_MRP_Type, PLA_MRP_Type_L
                                   , PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L
                                   , PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Special_Procurement, PLA_Special_Procurement_L, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2
                                   , PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2
                                   , PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L, PLA_Consumption_Mode, PLA_Consumption_Mode_L
                                   , PLA_Fwd_Comsumption, PLA_Fwd_Comsumption_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Bwd_Comsumption, PLA_Bwd_Comsumption_L
                                   , PLA_Forecast_Model, PLA_Forecast_Model_L, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Source_List, PLA_Source_List_L);
                    break;
                case "FORM-T012":
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L
                                   , PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group, PLA_MRP_Group_L, PLA_MRP_Type, PLA_MRP_Type_L
                                   , PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L
                                   , PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Special_Procurement, PLA_Special_Procurement_L, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time_L2
                                   , PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2
                                   , PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L, PLA_Consumption_Mode, PLA_Consumption_Mode_L
                                   , PLA_Fwd_Comsumption, PLA_Fwd_Comsumption_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Bwd_Comsumption, PLA_Bwd_Comsumption_L
                                   , PLA_Source_List, PLA_Source_List_L, PLA_Forecast_Model, PLA_Forecast_Model_L, PLA_Period_Indicator, PLA_Period_Indicator_L);
                    break;
                case "FORM-T006":
                    SetVisible(true, PLA_Plant_1, PLA_Plant_1_L, PLA_Storage_Location_1, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1, PLA_Plant_Sp_Matl_Status_1_L
                                   , PLA_MRP_Group_1, PLA_MRP_Group_1_L, PLA_MRP_Type_1, PLA_MRP_Type_1_L, PLA_MRP_Controller_1, PLA_MRP_Controller_1_L, PLA_Lot_Size_1, PLA_Lot_Size_1_L
                                   , PLA_Storage_Loc_For_EP_1, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1, PLA_GR_Processing_Time_1_L
                                   , PLA_SchedMargin_Key_1, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1, PLA_Availability_Check_1_L, PLA_Period_Indicator_1, PLA_Period_Indicator_1_L
                                   , PLA_Selection_Method_1, PLA_Selection_Method_1_L, PLA_Unlimited_1, PLA_Unlimited_1_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L
                                   , PLA_Plant, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Group, PLA_MRP_Group_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_ABC_Indicator, PLA_ABC_Indicator_L, PLA_Procurement_Type, PLA_Procurement_Type_L
                                   , PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Special_Procurement, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_GR_Processing_Time, PLA_GR_Processing_Time_L
                                   , PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L
                                   , PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Period_Indicator, PLA_Period_Indicator_L
                                   , PLA_Forecast_Model, PLA_Forecast_Model_L, PLA_Storage_Location, PLA_Rounding_Value, PLA_Rounding_Value_L);
                    break;
                case "FORM-T010":
                    PLA_Plant_1_L.Text = "P-Plant";
                    PLA_Plant_L.Text = "D-Plant";
                    PLA_Safety_Time_Act_Cov_L.Text = "Safety time";
                    SetVisible(true, PLA_Plant_1, PLA_Plant_1_L, PLA_Storage_Location_1, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1, PLA_Plant_Sp_Matl_Status_1_L
                                   , PLA_MRP_Group_1, PLA_MRP_Group_1_L, PLA_MRP_Type_1, PLA_MRP_Type_1_L, PLA_MRP_Controller_1, PLA_MRP_Controller_1_L, PLA_Lot_Size_1, PLA_Lot_Size_1_L
                                   , PLA_Storage_Loc_For_EP_1, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1, PLA_GR_Processing_Time_1_L
                                   , PLA_SchedMargin_Key_1, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1, PLA_Availability_Check_1_L, PLA_Period_Indicator_1, PLA_Period_Indicator_1_L
                                   , PLA_Selection_Method_1, PLA_Selection_Method_1_L, PLA_Unlimited_1, PLA_Unlimited_1_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L
                                   , PLA_Plant, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group, PLA_Purchasing_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Group, PLA_MRP_Group_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_ABC_Indicator, PLA_ABC_Indicator_L, PLA_Procurement_Type, PLA_Procurement_Type_L
                                   , PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Special_Procurement, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_GR_Processing_Time, PLA_GR_Processing_Time_L
                                   , PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L
                                   , PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Strategy_Group, PLA_Strategy_Group_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Period_Indicator, PLA_Period_Indicator_L
                                   , PLA_Forecast_Model, PLA_Forecast_Model_L, PLA_Storage_Location, PLA_Consumption_Mode, PLA_Consumption_Mode_L, PLA_Fwd_Comsumption, PLA_Fwd_Comsumption_L, PLA_Bwd_Comsumption, PLA_Bwd_Comsumption_L);
                    break;
                case "FORM-TW-010":
                    PLA_In_house_Production_Time_1_L.Text = "In-house production(days)";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L, PLA_Purchasing_Group, PLA_MRP_Type_L, PLA_MRP_Type, PLA_MRP_Group, PLA_MRP_Group_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_ABC_Indicator_L, PLA_ABC_Indicator, PLA_Procurement_Type_L, PLA_Procurement_Type, PLA_MRP_Controller_L, PLA_MRP_Controller, PLA_Special_Procurement_L, PLA_Special_Procurement, PLA_Storage_Loc_For_EP_L, PLA_Storage_Loc_For_EP, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time, PLA_SchedMargin_Key_L, PLA_SchedMargin_Key, PLA_Safty_Stock_L, PLA_Safty_Stock, PLA_Safety_Time_Ind_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov, PLA_Strategy_Group_L, PLA_Strategy_Group, PLA_Consumption_Mode_L, PLA_Consumption_Mode
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_Fwd_Comsumption_L, PLA_Fwd_Comsumption, PLA_Bwd_Comsumption_L, PLA_Bwd_Comsumption, PLA_Period_Indicator_L, PLA_Period_Indicator, PLA_Forecast_Model_L, PLA_Forecast_Model);
                    SetVisible(true, PLA_Plant_1, PLA_Plant_1_L, PLA_Storage_Location_1, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1, PLA_MRP_Group_1_L, PLA_MRP_Type_1, PLA_MRP_Type_1_L, PLA_MRP_Controller_1, PLA_MRP_Controller_1_L, PLA_Lot_Size_1, PLA_Lot_Size_1_L, PLA_Storage_Loc_For_EP_1, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1, PLA_Procurement_Type_1_L, PLA_In_house_Production_Time_1, PLA_In_house_Production_Time_1_L, PLA_GR_Processing_Time_1, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1, PLA_Availability_Check_1_L, PLA_Period_Indicator_1, PLA_Period_Indicator_1_L, PLA_Selection_Method_1, PLA_Selection_Method_1_L, PLA_Unlimited_1, PLA_Unlimited_1_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    SetVisible(true, PLA_Production_Planner, PLA_Production_Planner_L, PLA_SNP_Planner, PLA_SNP_Planner_L, PLA_Safety_Stock_Method, PLA_Safety_Stock_Method_L);
                    break;
                case "FORM-TW-011":
                    PLA_In_house_Production_Time_L.Text = "In-house production(days)";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Type_L, PLA_MRP_Type, PLA_MRP_Group, PLA_MRP_Group_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_Procurement_Type, PLA_MRP_Controller_L, PLA_MRP_Controller, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_Prod_Stor_Loc_L, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP_L, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key_L, PLA_SchedMargin_Key, PLA_Safty_Stock_L, PLA_Safty_Stock, PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_Period_Indicator_L, PLA_Period_Indicator
                                   , PLA_In_house_Production_Time_L, PLA_In_house_Production_Time, PLA_Selection_Method_L, PLA_Selection_Method, PLA_Individual_Coll_L, PLA_Individual_Coll, PLA_Unlimited, PLA_Unlimited_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L
                                   , PLA_Production_Planner_L, PLA_Production_Planner, PLA_SNP_Planner_L, PLA_SNP_Planner, PLA_Safety_Stock_Method_L, PLA_Safety_Stock_Method);

                    break;
                case "FORM-TW-004":
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Purchasing_Group, PLA_Purchasing_Group_L, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Type_L, PLA_MRP_Type, PLA_ABC_Indicator, PLA_ABC_Indicator_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_Procurement_Type, PLA_MRP_Controller_L, PLA_MRP_Controller, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_Prod_Stor_Loc_L, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP_L, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key_L, PLA_SchedMargin_Key, PLA_Safty_Stock_L, PLA_Safty_Stock, PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_Period_Indicator_L, PLA_Period_Indicator
                                   , PLA_PO_Price, PLA_PO_Price_L, PLA_Individual_Coll_L, PLA_Individual_Coll, PLA_Special_Procurement, PLA_Special_Procurement_L, PLA_Rounding_Value, PLA_Rounding_Value_L, PLA_Backflush, PLA_Backflush_L, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L, PLA_Stock_Det_Grp, PLA_Stock_Det_Grp_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Source_List_L, PLA_Source_List);

                    break;
                case "FORM-TW-007":
                    PLA_In_house_Production_Time_L.Text = "In-house production(days)";
                    PLA_Planned_Delivery_Time_L.Text = "Planned delivery time(days)";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L, PLA_Purchasing_Group, PLA_MRP_Type_L, PLA_MRP_Type, PLA_MRP_Group, PLA_MRP_Group_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_ABC_Indicator_L, PLA_ABC_Indicator, PLA_Procurement_Type_L, PLA_Procurement_Type, PLA_Special_Procurement_L, PLA_Special_Procurement, PLA_Storage_Loc_For_EP_L, PLA_Storage_Loc_For_EP, PLA_GR_Processing_Time_L, PLA_GR_Processing_Time, PLA_Planned_Delivery_Time_L, PLA_Planned_Delivery_Time, PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_SchedMargin_Key_L, PLA_SchedMargin_Key, PLA_Safty_Stock_L, PLA_Safty_Stock, PLA_Safety_Time_Ind_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov, PLA_Strategy_Group_L, PLA_Strategy_Group, PLA_Consumption_Mode_L, PLA_Consumption_Mode
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_Fwd_Comsumption_L, PLA_Fwd_Comsumption, PLA_Bwd_Comsumption_L, PLA_Bwd_Comsumption, PLA_Period_Indicator_L, PLA_Period_Indicator, PLA_Forecast_Model_L, PLA_Forecast_Model, PLA_Selection_Method, PLA_Selection_Method_L, PLA_Selection_Method, PLA_Unlimited, PLA_Unlimited_L, PLA_Product_Scheduling_L, PLA_Product_Scheduling
                                   , PLA_Safety_Stock_Method, PLA_Safety_Stock_Method_L, PLA_Rounding_Value, PLA_Rounding_Value_L, PLA_SNP_Planner, PLA_SNP_Planner_L, PLA_Production_Planner, PLA_Production_Planner_L);
                    break;
                case "FORM-TW-007-1":
                    PLA_In_house_Production_Time_L.Text = "In-house production(days)";
                    SetVisible(true, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Type_L, PLA_MRP_Type, PLA_MRP_Group, PLA_MRP_Group_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_Procurement_Type_L, PLA_Procurement_Type, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_Storage_Loc_For_EP, PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_SchedMargin_Key_L, PLA_SchedMargin_Key, PLA_Safty_Stock_L, PLA_Safty_Stock
                                   , PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_Period_Indicator_L, PLA_Period_Indicator, PLA_Selection_Method, PLA_Selection_Method_L, PLA_Unlimited, PLA_Unlimited_L, PLA_Individual_Coll_L, PLA_Individual_Coll, PLA_Fwd_Comsumption, PLA_Fwd_Comsumption_L, PLA_Product_Scheduling_L, PLA_Product_Scheduling
                                   , PLA_Production_Planner, PLA_Production_Planner_L, PLA_SNP_Planner, PLA_SNP_Planner_L);
                    break;
                case "FORM-T008":
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group, PLA_MRP_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L
                                   , PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L
                                   , PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L
                                   , PLA_Availability_Check, PLA_Availability_Check_L, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Selection_Method, PLA_Selection_Method_L
                                   , PLA_Individual_Coll, PLA_Individual_Coll_L, PLA_Unlimited, PLA_Unlimited_L, PLA_Unit_of_issue, PLA_Unit_of_issue_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    //SetVisible(false, PLA_Unit_of_issue, PLA_Unit_of_issue_L);
                    break;
                case "FORM-T011":
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group, PLA_MRP_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L
                                   , PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L
                                   , PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L
                                   , PLA_Availability_Check, PLA_Availability_Check_L, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Selection_Method, PLA_Selection_Method_L
                                   , PLA_Individual_Coll, PLA_Individual_Coll_L, PLA_Unlimited, PLA_Unlimited_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    break;
                case "FORM-T003":
                    PLA_Title.Text = "Purchasing";
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location_L, PLA_Storage_Location, PLA_Purchasing_Group, PLA_Purchasing_Group_L, PLA_Source_List, PLA_Source_List_L
                                   , PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_ABC_Indicator, PLA_ABC_Indicator_L, PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L
                                   , PLA_Lot_Size, PLA_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L
                                   , PLA_Special_Procurement, PLA_Special_Procurement_L, PLA_Rounding_Value, PLA_Rounding_Value_L, PLA_Backflush, PLA_Backflush_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L
                                   , PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L
                                   , PLA_Planned_Delivery_Time_L2, PLA_Stock_Det_Grp, PLA_Stock_Det_Grp_L, PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Safety_Time_Ind, PLA_Safety_Time_Ind_L, PLA_PO_Price, PLA_PO_Price_L
                                   , PLA_Availability_Check, PLA_Availability_Check_L, PLA_Safety_Time_Act_Cov, PLA_Safety_Time_Act_Cov_L, PLA_Safety_Time_Act_Cov_L2, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Individual_Coll, PLA_Individual_Coll_L);
                    break;
                case "FORM-T018":
                    PLA_Title.Text = "Purchasing/Technical";
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L);
                    SetVisible(false, PLA_Purchasing_Group, PLA_Purchasing_Group_L, PLA_Forecast_Model, PLA_Forecast_Model_L);
                    break;
                case "FORM-T007":
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group, PLA_MRP_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L
                                   , PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L
                                   , PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_In_house_Production_Time_L2, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L
                                   , PLA_Safty_Stock, PLA_Safty_Stock_L, PLA_Availability_Check, PLA_Availability_Check_L, PLA_Period_Indicator, PLA_Period_Indicator_L
                                   , PLA_Selection_Method, PLA_Selection_Method_L, PLA_Individual_Coll, PLA_Individual_Coll_L, PLA_Unlimited, PLA_Unlimited_L, PLA_Unit_of_issue, PLA_Unit_of_issue_L
                                   , PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    SetVisible(true, PLA_Backflush_L, PLA_Backflush, PLA_Production_Planner_L, PLA_Production_Planner, PLA_Safety_Stock_Method_L, PLA_Safety_Stock_Method, PLA_SNP_Planner_L, PLA_SNP_Planner);
                    break;
                case "FORM-T011-1":
                    SetVisible(true, PLA_Plant, PLA_Plant_L, PLA_Storage_Location, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group, PLA_MRP_Group_L
                                   , PLA_MRP_Type, PLA_MRP_Type_L, PLA_MRP_Controller, PLA_MRP_Controller_L, PLA_Lot_Size, PLA_Lot_Size_L, PLA_Minimum_Lot_Size, PLA_Minimum_Lot_Size_L
                                   , PLA_Fix_Lot_Size, PLA_Fix_Lot_Size_L, PLA_Maximum_Lot_Size, PLA_Maximum_Lot_Size_L, PLA_Procurement_Type, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc, PLA_Prod_Stor_Loc_L
                                   , PLA_In_house_Production_Time, PLA_In_house_Production_Time_L, PLA_Storage_Loc_For_EP, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key, PLA_SchedMargin_Key_L, PLA_Safty_Stock, PLA_Safty_Stock_L
                                   , PLA_Availability_Check, PLA_Availability_Check_L, PLA_Period_Indicator, PLA_Period_Indicator_L, PLA_Selection_Method, PLA_Selection_Method_L
                                   , PLA_Individual_Coll, PLA_Individual_Coll_L, PLA_Unlimited, PLA_Unlimited_L, PLA_Product_Scheduling, PLA_Product_Scheduling_L);
                    SetVisible(true, PLA_Backflush_L, PLA_Backflush, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L, PLA_Production_Planner, PLA_SNP_Planner, PLA_Safety_Stock_Method);
                    break;
            }

            SetToolTip();
            #endregion
        }
        #endregion

        #region 方法 Distribute,Collect(分发, 收集值)
        public void Distribute(mdc_Material mt)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            if (!IsUsed)
            {
                return;
            }
            //string s = PLA_Planning_Material.Text + PLA_Strategy_Group.SelectedValue;
            //if (!string.IsNullOrEmpty(s) && FORM == "FORM-005" && Category == "FINI")
            //{
            //    TaskAPI.DirectActive("Inform Sales");
            //}
            PLA_FINI_Material_Code.Text = mt.PLA_FINI_Material_Code;
            PLA_Plant.SelectedValue = mt.PLA_Plant;
            PLA_Plant_SelectedIndexChanged(null, null);
            PLA_Storage_Location.Text = mt.PLA_Storage_Location;
            PLA_ICD.SelectedValue = mt.PLA_ICD;
            PLA_IsPurchase.SelectedValue = mt.PLA_IsPurchase;
            PLA_MRP_Controller.Text = mt.PLA_MRP_Controller;
            PLA_MRP_Type.Text = mt.PLA_MRP_Type;
            PLA_Lot_Size.Text = mt.PLA_Lot_Size;
            PLA_Lot_Size_TextChanged(null, null);
            PLA_Purchasing_Group.SelectedValue = mt.PLA_Purchasing_Group;
            PLA_Procurement_Type_SelectedIndexChanged(null, null);
            PLA_Procurement_Type.SelectedValue = mt.PLA_Procurement_Type;
            PLA_Special_Procurement.SelectedValue = mt.PLA_Special_Procurement;
            PLA_Prod_Stor_Loc.Text = mt.PLA_Prod_Stor_Loc;
            PLA_MRP_Group.Text = mt.PLA_MRP_Group;
            PLA_Fix_Lot_Size.Text = mt.PLA_Fix_Lot_Size;
            PLA_Overdely_Tol.Text = mt.PLA_Overdely_Tol;
            PLA_Unlimited.Checked = mt.PLA_Unlimited == "1";
            PLA_Minimum_Lot_Size.Text = mt.PLA_Minimum_Lot_Size;
            PLA_Maximum_Lot_Size.Text = mt.PLA_Maximum_Lot_Size;
            PLA_Rounding_Value.Text = mt.PLA_Rounding_Value;
            PLA_In_house_Production_Time.Text = mt.PLA_In_house_Production_Time;
            PLA_Planned_Delivery_Time.Text = mt.PLA_Planned_Delivery_Time;
            PLA_GR_Processing_Time.Text = mt.PLA_GR_Processing_Time;
            PLA_Safety_Time_Act_Cov.Text = mt.PLA_Safety_Time_Act_Cov;
            PLA_Safty_Stock.Text = mt.PLA_Safty_Stock;
            PLA_Safety_Time_Ind.Text = mt.PLA_Safety_Time_Ind;
            SetSaftyStock();
            PLA_Stock_Det_Grp.Text = mt.PLA_Stock_Det_Grp;
            PLA_With_Qty_Struture.SelectedValue = mt.PLA_With_Qty_Struture;
            PLA_Valuation_Class.Text = mt.PLA_Valuation_Class;
            PLA_Forecast_Model.SelectedValue = mt.PLA_Forecast_Model;
            PLA_Plant_Sp_Matl_Status.SelectedValue = mt.PLA_Plant_Sp_Matl_Status;
            PLA_Do_Not_Cost.Checked = mt.PLA_Do_Not_Cost == "1";
            PLA_Is_MTS_MTO.SelectedValue = mt.PLA_Is_MTS_MTO;
            PLA_ABC_Indicator.SelectedValue = mt.PLA_ABC_Indicator;
            PLA_Backflush.Text = mt.PLA_Backflush;
            PLA_Individual_Coll.Text = mt.PLA_Individual_Coll;
            PLA_Planning_Material.Text = mt.PLA_Planning_Material;
            PLA_Planning_Plant.Text = mt.PLA_Planning_Plant;
            PLA_Selection_Method.SelectedValue = mt.PLA_Selection_Method;
            PLA_Availability_Check.Text = mt.PLA_Availability_Check;
            PLA_SchedMargin_Key.Text = mt.PLA_SchedMargin_Key;
            PLA_Period_Indicator.Text = mt.PLA_Period_Indicator;
            PLA_Deletion_Flag.Checked = mt.PLA_Deletion_Flag == "1";
            PLA_Consumption_Mode.SelectedValue = mt.PLA_Consumption_Mode;
            PLA_Consumption_Mode_SelectedIndexChanged(null, null);
            PLA_Bwd_Comsumption.Text = mt.PLA_Bwd_Comsumption;
            PLA_Fwd_Comsumption.Text = mt.PLA_Fwd_Comsumption;
            PLA_Plng_Conv_Factor.Text = mt.PLA_Plng_Conv_Factor;
            PLA_Planning_Matl_BUnit.Text = mt.PLA_Planning_Matl_BUnit;
            PLA_Storage_Loc_For_EP.Text = mt.PLA_Storage_Loc_For_EP;
            PLA_Strategy_Group.Text = mt.PLA_Strategy_Group;

            PLA_Plant_1.SelectedValue = mt.PLA_Plant_1;
            PLA_Storage_Location_1.Text = mt.PLA_Storage_Location_1;
            PLA_Plant_Sp_Matl_Status_1.SelectedValue = mt.PLA_Plant_Sp_Matl_Status_1;
            PLA_MRP_Group_1.Text = mt.PLA_MRP_Group_1;
            PLA_MRP_Type_1.Text = mt.PLA_MRP_Type_1;
            PLA_MRP_Controller_1.Text = mt.PLA_MRP_Controller_1;
            PLA_Lot_Size_1.Text = mt.PLA_Lot_Size_1;
            PLA_Storage_Loc_For_EP_1.Text = mt.PLA_Storage_Loc_For_EP_1;
            PLA_Procurement_Type_1.SelectedValue = mt.PLA_Procurement_Type_1;
            PLA_In_house_Production_Time_1.Text = mt.PLA_In_house_Production_Time_1;
            PLA_GR_Processing_Time_1.Text = mt.PLA_GR_Processing_Time_1;
            PLA_SchedMargin_Key_1.Text = mt.PLA_SchedMargin_Key_1;
            PLA_Availability_Check_1.Text = mt.PLA_Availability_Check_1;
            PLA_Period_Indicator_1.Text = mt.PLA_Period_Indicator_1;
            PLA_Selection_Method_1.Text = mt.PLA_Selection_Method_1;
            PLA_Unlimited_1.Checked = mt.PLA_Unlimited_1 == "1";
            PLA_Product_Scheduling.Text = mt.PLA_Product_Scheduling;
            PLA_Source_List.Checked = mt.PLA_Source_List == "1";
            PLA_Unit_of_issue.Text = mt.PLA_Unit_of_issue;

            PLA_PO_Price.Text = mt.PLA_PO_Price;

            //Tang Bin 新加
            PLA_Safety_Stock_Method.Text = mt.PLA_Safety_Stock_Method;
            PLA_SNP_Planner.Text = mt.PLA_SNP_Planner;
            PLA_Production_Planner.Text = mt.PLA_Production_Planner;
            PLA_Special_Procurement1.Text = mt.PLA_Special_Procurement1;
            PLA_Tot_repl_lead_time.Text = mt.PLA_Tot_repl_lead_time;
        }

        public void Collect(ref mdc_Material mt)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            if (!IsUsed)
            {
                return;
            }

            mt.PLA_FINI_Material_Code = PLA_FINI_Material_Code.Text;
            mt.PLA_Plant = PLA_Plant.SelectedValue;
            mt.PLA_Storage_Location = PLA_Storage_Location.Text;
            mt.PLA_ICD = PLA_ICD.SelectedValue;
            mt.PLA_IsPurchase = PLA_IsPurchase.SelectedValue;
            mt.PLA_MRP_Controller = PLA_MRP_Controller.Text;
            mt.PLA_MRP_Type = PLA_MRP_Type.Text;
            mt.PLA_Lot_Size = PLA_Lot_Size.Text;
            mt.PLA_Purchasing_Group = PLA_Purchasing_Group.SelectedValue;
            mt.PLA_Procurement_Type = PLA_Procurement_Type.SelectedValue;
            mt.PLA_Special_Procurement = PLA_Special_Procurement.SelectedValue;
            mt.PLA_Prod_Stor_Loc = PLA_Prod_Stor_Loc.Text;
            mt.PLA_MRP_Group = PLA_MRP_Group.Text;
            mt.PLA_Fix_Lot_Size = PLA_Fix_Lot_Size.Text;
            mt.PLA_Overdely_Tol = PLA_Overdely_Tol.Text;
            mt.PLA_Unlimited = PLA_Unlimited.Checked ? "1" : "0";
            mt.PLA_Minimum_Lot_Size = PLA_Minimum_Lot_Size.Text;
            mt.PLA_Maximum_Lot_Size = PLA_Maximum_Lot_Size.Text;
            mt.PLA_Rounding_Value = PLA_Rounding_Value.Text;
            mt.PLA_In_house_Production_Time = PLA_In_house_Production_Time.Text;
            mt.PLA_Planned_Delivery_Time = PLA_Planned_Delivery_Time.Text;
            mt.PLA_GR_Processing_Time = PLA_GR_Processing_Time.Text;
            mt.PLA_Safety_Time_Act_Cov = PLA_Safety_Time_Act_Cov.Text;
            mt.PLA_Safty_Stock = PLA_Safty_Stock.Text;
            mt.PLA_Safety_Time_Ind = PLA_Safety_Time_Ind.Text;
            mt.PLA_Stock_Det_Grp = PLA_Stock_Det_Grp.Text;
            mt.PLA_With_Qty_Struture = PLA_With_Qty_Struture.SelectedValue;
            mt.PLA_Valuation_Class = PLA_Valuation_Class.Text;
            mt.PLA_Forecast_Model = PLA_Forecast_Model.SelectedValue;
            mt.PLA_Plant_Sp_Matl_Status = PLA_Plant_Sp_Matl_Status.SelectedValue;
            mt.PLA_Do_Not_Cost = PLA_Do_Not_Cost.Checked ? "1" : "0";
            mt.PLA_Is_MTS_MTO = PLA_Is_MTS_MTO.SelectedValue;
            mt.PLA_ABC_Indicator = PLA_ABC_Indicator.SelectedValue;
            mt.PLA_Backflush = PLA_Backflush.Text;
            mt.PLA_Individual_Coll = PLA_Individual_Coll.Text;
            mt.PLA_Planning_Material = PLA_Planning_Material.Text;
            mt.PLA_Planning_Plant = PLA_Planning_Plant.Text;
            mt.PLA_Selection_Method = PLA_Selection_Method.SelectedValue;
            mt.PLA_Availability_Check = PLA_Availability_Check.Text;
            mt.PLA_SchedMargin_Key = PLA_SchedMargin_Key.Text;
            mt.PLA_Period_Indicator = PLA_Period_Indicator.Text;
            mt.PLA_Deletion_Flag = PLA_Deletion_Flag.Checked ? "1" : "0";
            mt.PLA_Consumption_Mode = PLA_Consumption_Mode.SelectedValue;
            mt.PLA_Bwd_Comsumption = PLA_Bwd_Comsumption.Text;
            mt.PLA_Fwd_Comsumption = PLA_Fwd_Comsumption.Text;
            mt.PLA_Plng_Conv_Factor = PLA_Plng_Conv_Factor.Text;
            mt.PLA_Planning_Matl_BUnit = PLA_Planning_Matl_BUnit.Text;
            mt.PLA_Storage_Loc_For_EP = PLA_Storage_Loc_For_EP.Text;
            mt.PLA_Strategy_Group = PLA_Strategy_Group.Text;


            mt.PLA_Plant_1 = PLA_Plant_1.SelectedValue;
            mt.PLA_Storage_Location_1 = PLA_Storage_Location_1.Text;
            mt.PLA_Plant_Sp_Matl_Status_1 = PLA_Plant_Sp_Matl_Status_1.SelectedValue;
            mt.PLA_MRP_Group_1 = PLA_MRP_Group_1.Text;
            mt.PLA_MRP_Type_1 = PLA_MRP_Type_1.Text;
            mt.PLA_MRP_Controller_1 = PLA_MRP_Controller_1.Text;
            mt.PLA_Lot_Size_1 = PLA_Lot_Size_1.Text;
            mt.PLA_Storage_Loc_For_EP_1 = PLA_Storage_Loc_For_EP_1.Text;
            mt.PLA_Procurement_Type_1 = PLA_Procurement_Type_1.SelectedValue;
            mt.PLA_In_house_Production_Time_1 = PLA_In_house_Production_Time_1.Text;
            mt.PLA_GR_Processing_Time_1 = PLA_GR_Processing_Time_1.Text;
            mt.PLA_SchedMargin_Key_1 = PLA_SchedMargin_Key_1.Text;
            mt.PLA_Availability_Check_1 = PLA_Availability_Check_1.Text;
            mt.PLA_Period_Indicator_1 = PLA_Period_Indicator_1.Text;
            mt.PLA_Selection_Method_1 = PLA_Selection_Method_1.Text;
            mt.PLA_Unlimited_1 = PLA_Unlimited_1.Checked ? "1" : "0";
            mt.PLA_Product_Scheduling = PLA_Product_Scheduling.Text;
            mt.PLA_Source_List = PLA_Source_List.Checked ? "1" : "0";
            mt.PLA_Unit_of_issue = PLA_Unit_of_issue.Text;

            mt.PLA_PO_Price = PLA_PO_Price.Text;
            //Tang Bin
            mt.PLA_Safety_Stock_Method = PLA_Safety_Stock_Method.Text;
            mt.PLA_SNP_Planner = PLA_SNP_Planner.Text;
            mt.PLA_Production_Planner = PLA_Production_Planner.Text;
            mt.PLA_Tot_repl_lead_time = PLA_Tot_repl_lead_time.Text;
            mt.PLA_Special_Procurement1 = PLA_Special_Procurement1.Text;
        }
        #endregion

        #region 方法 SetDefaultValue(设置默认值, 并禁用输入)
        public void SetDefaultValue()
        {
            switch (Category)
            {
                case "RAW":


                    PLA_Availability_Check.Text = "KP";
                    PLA_Backflush.Text = "1";
                    PLA_Individual_Coll.Text = "2";
                    PLA_MRP_Type.Text = "PD, MRP";
                    PLA_Period_Indicator.Text = "M";
                    PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                    PLA_Procurement_Type.SelectedValue = "F";
                    PLA_SchedMargin_Key.Text = "010";
                    PLA_Storage_Location.Text = "0100, Raw Mat. Powders";
                    PLA_With_Qty_Struture.SelectedValue = "Y";
                    SetForeColor(Color.Blue, PLA_Special_Procurement_L);  //当Procurement type为E时不用填，为F时必填
                    SetEnable(false, PLA_Availability_Check, PLA_Backflush, PLA_Individual_Coll, PLA_MRP_Type, PLA_Period_Indicator, PLA_Plant_Sp_Matl_Status, PLA_Procurement_Type, PLA_SchedMargin_Key, PLA_Storage_Location, PLA_With_Qty_Struture);
                    SetForeColor(Color.Orange, PLA_Availability_Check_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_MRP_Type_L, PLA_Period_Indicator_L, PLA_Plant_Sp_Matl_Status_L, PLA_Procurement_Type_L, PLA_SchedMargin_Key_L, PLA_Storage_Location_L, PLA_With_Qty_Struture_L);


                    break;

                case "PACK":
                    PLA_Availability_Check.Text = "KP";
                    PLA_Backflush.Text = "1";
                    PLA_Individual_Coll.Text = "2";
                    PLA_MRP_Type.Text = "PD, MRP";
                    PLA_Period_Indicator.Text = "M";
                    PLA_Procurement_Type.SelectedValue = "F";
                    PLA_SchedMargin_Key.Text = "002";
                    PLA_Purchasing_Group.SelectedValue = "K02";
                    PLA_Special_Procurement.SelectedValue = "20";
                    PLA_Storage_Location.Text = "0150, Raw Mat. Packg";
                    PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                    PLA_With_Qty_Struture.SelectedValue = "Y";
                    //SetForeColor(Color.Blue, PLA_Special_Procurement_L);  //当Procurement type为E时不用填，为F时必填
                    SetEnable(false, PLA_Availability_Check, PLA_Backflush, PLA_Individual_Coll, PLA_MRP_Type, PLA_Period_Indicator, PLA_Procurement_Type, PLA_SchedMargin_Key, PLA_Special_Procurement, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_With_Qty_Struture, PLA_Purchasing_Group);
                    SetForeColor(Color.Orange, PLA_Availability_Check_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_MRP_Type_L, PLA_Period_Indicator_L, PLA_Procurement_Type_L, PLA_SchedMargin_Key_L, PLA_Special_Procurement_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_With_Qty_Struture_L, PLA_Purchasing_Group_L);
                    if (FORM == "FORM-043")
                    {
                        PLA_Plant.SelectedValue = "K15P";
                        SetEnable(false, PLA_Plant);
                        SetForeColor(Color.Orange, PLA_Plant_L);
                    }
                    break;
                case "SEFI":
                    if (FORM == "FORM-035")
                    {
                        PLA_Plant.SelectedValue = "K15P";
                        PLA_Storage_Location.Text = "0020";
                        PLA_MRP_Group.Text = "SEFI";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Special_Procurement.SelectedIndex = -1;
                        PLA_Prod_Stor_Loc.Text = "0020";
                        PLA_Storage_Loc_For_EP.Text = "";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_With_Qty_Struture.SelectedValue = "Y";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Availability_Check.Text = "KP";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_MRP_Group, PLA_Plant_Sp_Matl_Status, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_With_Qty_Struture, PLA_Period_Indicator, PLA_Availability_Check, PLA_Selection_Method, PLA_Individual_Coll, PLA_Unlimited);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_With_Qty_Struture_L, PLA_Period_Indicator_L, PLA_Availability_Check_L, PLA_Selection_Method_L, PLA_Individual_Coll_L);
                    }
                    else if (FORM == "FORM-T008")
                    {
                        PLA_Plant.SelectedValue = "KT1P";
                        PLA_Storage_Location.Text = "0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Group.Text = "SEFI";
                        //if ((Page as PMDC).TabMaterial1.Technical1.TEC_Top_Sefi.SelectedValue == "Y")
                        //{
                        PLA_MRP_Type.Text = "M0";
                        PLA_MRP_Controller.Text = "ES0";
                        //}
                        //else if ((Page as PMDC).TabMaterial1.Technical1.TEC_Top_Sefi.SelectedValue == "N")
                        //{
                        //    PLA_MRP_Type.Text = "PD";
                        //    PLA_MRP_Controller.Text = "ESL";
                        //}
                        //else
                        //{
                        //    PLA_MRP_Type.Text = "";
                        //    PLA_MRP_Controller.Text = "";
                        //}
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_Storage_Loc_For_EP.Text = "0200";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        PLA_Unit_of_issue.Text = "L";
                        PLA_Product_Scheduling.Text = "Z00001";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller, PLA_Procurement_Type
                                       , PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Selection_Method, PLA_Individual_Coll
                                       , PLA_Unlimited, PLA_Unit_of_issue, PLA_Product_Scheduling);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Procurement_Type_L
                                                 , PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Selection_Method_L, PLA_Individual_Coll_L
                                                 , PLA_Unlimited_L, PLA_Unit_of_issue_L, PLA_Product_Scheduling_L);
                    }
                    else if (FORM == "FORM-T011")
                    {
                        PLA_Plant.SelectedValue = "KT2P";
                        PLA_Storage_Location.Text = "0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Group.Text = "SEFI";
                        //if ((Page as PMDC).TabMaterial1.Technical1.TEC_Top_Sefi.SelectedValue == "Y")
                        //{
                        //    PLA_MRP_Type.Text = "M0";
                        //    PLA_MRP_Controller.Text = "ESP";
                        //}
                        //else
                        //{
                        //    PLA_MRP_Type.Text = "PD";
                        //    PLA_MRP_Controller.Text = "ESL";
                        //}
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_Storage_Loc_For_EP.Text = "0200";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller, PLA_Procurement_Type
                                       , PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Selection_Method, PLA_Individual_Coll
                                       , PLA_Unlimited, PLA_Unit_of_issue, PLA_Product_Scheduling);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Procurement_Type_L
                                                 , PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Selection_Method_L, PLA_Individual_Coll_L
                                                 , PLA_Unlimited_L, PLA_Unit_of_issue_L, PLA_Product_Scheduling_L);
                    }
                    else if (FORM == "FORM-T011-1")
                    {
                        PLA_Plant.SelectedValue = "KT2P";
                        PLA_Storage_Location.Text = "0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Group.Text = "SEFI";
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_Storage_Loc_For_EP.Text = "0200";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_MRP_Group, PLA_Procurement_Type
                                       , PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Selection_Method, PLA_Individual_Coll
                                       , PLA_Unlimited, PLA_Unit_of_issue, PLA_Product_Scheduling);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Procurement_Type_L
                                                 , PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Selection_Method_L, PLA_Individual_Coll_L
                                                 , PLA_Unlimited_L, PLA_Unit_of_issue_L, PLA_Product_Scheduling_L);
                    }
                    else if (FORM == "FORM-T007")
                    {
                        PLA_Plant.SelectedValue = "KT1P";
                        PLA_Storage_Location.Text = "0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Group.Text = "SEFI";
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_Storage_Loc_For_EP.Text = "0200";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        PLA_Unit_of_issue.Text = "L";
                        PLA_Product_Scheduling.Text = "Z00001";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_MRP_Group, PLA_Procurement_Type
                                       , PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Selection_Method, PLA_Individual_Coll
                                       , PLA_Unlimited, PLA_Unit_of_issue, PLA_Product_Scheduling);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Procurement_Type_L
                                                 , PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Selection_Method_L, PLA_Individual_Coll_L
                                                 , PLA_Unlimited_L, PLA_Unit_of_issue_L, PLA_Product_Scheduling_L);

                    }
                    else if (FORM == "FORM-012")
                    {
                        if (TaskAPI.Process == "MTO Base Code Application")
                        {
                            //TB 修改内外部的显示状态
                            if (TaskAPI.Step == "Planning")
                            {
                                SetEnable(true, PLA_Special_Procurement1);
                            }
                            else
                            {
                                SetEnable(false, PLA_Special_Procurement1);
                            }
                            SetForeColor(Color.Black, PLA_Special_Procurement1_L);


                            string subline = (Page as PMDC).TabMaterial1.Technical1.TEC_Subline.Text;
                            string please_Select = (Page as PMDC).Distribute.SelectedValue.ToString();
                            //D-Plant Fini-1string plant = (Page as PMDC).TabMaterial1.Planning1.PLA_Plant.SelectedValue.ToString();
                            m_MTO_Planning m_Planning = null;

                            m_Planning = (m_MTO_Planning.type == "4" & m_MTO_Planning.sub_Line == subline & m_MTO_Planning.please_Select == please_Select).ListFirst<m_MTO_Planning>();
                            if (m_Planning != null)
                            {
                                PLA_Plant.SelectedValue = m_Planning.Plant;// "K29P";
                                PLA_Storage_Location.Text = m_Planning.Storange_Location;// "0010";
                                PLA_ICD.SelectedValue = m_Planning.ICD;// "N";
                                PLA_MRP_Controller.Text = m_Planning.MRP_Controller;// "EFO";
                                PLA_MRP_Type.Text = m_Planning.MRP_Type;// "M0";
                                PLA_Lot_Size.Text = m_Planning.Lot_Size;// "EX";
                                //PLA_Special_Procurement.SelectedValue = m_Planning.Special_Procurement;// "";
                                PLA_Special_Procurement1.Text = m_Planning.Special_Procurement;
                                PLA_Procurement_Type.SelectedValue = m_Planning.Procurement_Type;// "E";
                                PLA_Purchasing_Group.SelectedValue = m_Planning.Purchasing_Group;// "";
                                PLA_Prod_Stor_Loc.Text = m_Planning.Prod_Stor_Loc;
                                PLA_Storage_Loc_For_EP.Text = m_Planning.Storage_loc_for_EP;
                                PLA_MRP_Group.Text = m_Planning.MRP_Group;// "MTO";
                                PLA_Minimum_Lot_Size.Text = m_Planning.Minimum_Lot_Size;// "";
                                PLA_Maximum_Lot_Size.Text = m_Planning.Maximum_Lot_Size;// "";
                                PLA_With_Qty_Struture.SelectedValue = m_Planning.With_Qty_Stuture;// "Y";
                                PLA_Availability_Check.Text = m_Planning.Availability_Check;// "Z3";
                                PLA_Planning_Material.Text = m_Planning.Planning_Material;// "";
                                PLA_Planning_Matl_BUnit.Text = m_Planning.Planning_matl_Bunit;// "";
                                PLA_Planning_Plant.SelectedValue = m_Planning.Planning_Plant;// "";
                                PLA_Strategy_Group.Text = m_Planning.Strategy_Group;// "";
                                PLA_Plng_Conv_Factor.Text = m_Planning.PIng_Conv_factor;// "";
                                PLA_Plant_Sp_Matl_Status.SelectedValue = m_Planning.Plant_sp_malt_status;

                                PLA_Fix_Lot_Size.Text = m_Planning.Fix_Lot_size;
                                //PLA_Unlimited.Checked = m_Planning.Unlimited == "X" ? true : false;
                                if (m_Planning.Unlimited == "√")
                                {
                                    PLA_Unlimited.Checked = true;
                                }
                                else
                                {
                                    PLA_Unlimited.Checked = false;
                                }
                                PLA_Overdely_Tol.Text = m_Planning.Overdely_tol;
                                PLA_Rounding_Value.Text = m_Planning.Rounding_value;
                                PLA_GR_Processing_Time.Text = m_Planning.GR_Processing_Time;
                                PLA_In_house_Production_Time.Text = m_Planning.In_house_production;
                                PLA_Planned_Delivery_Time.Text = m_Planning.Planned_delivery_time;
                                PLA_Safety_Time_Act_Cov.Text = m_Planning.Safety_time_act_cov;
                                PLA_Safty_Stock.Text = m_Planning.Safety_Stock;
                                PLA_Safety_Time_Ind.Text = m_Planning.Safety_time_ind;
                                PLA_ABC_Indicator.SelectedValue = m_Planning.ABC_Indicator;
                                PLA_Individual_Coll.Text = m_Planning.Individual_coll;
                                PLA_SchedMargin_Key.Text = m_Planning.SchedMargin_key;
                                PLA_Selection_Method.SelectedValue = m_Planning.Selection_method;
                                PLA_Period_Indicator.Text = m_Planning.Period_Indicator;
                                PLA_Forecast_Model.SelectedValue = m_Planning.Forecast_model;
                                PLA_Consumption_Mode.SelectedValue = m_Planning.Consumption_mode;
                                PLA_Bwd_Comsumption.Text = m_Planning.Bwd_consumption_per;
                                PLA_Fwd_Comsumption.Text = m_Planning.Fwd_consumption_per;
                            }
                            //PLA_Plant.SelectedValue = "K29P";
                            //PLA_Storage_Location.Text = "0200";
                            //PLA_ICD.SelectedValue = "Y";
                            //PLA_MRP_Controller.Text = "ESP";
                            //PLA_MRP_Type.Text = "M0";
                            //PLA_Lot_Size.Text = "EX";
                            //PLA_Special_Procurement.SelectedValue = "";
                            //PLA_Procurement_Type.SelectedValue = "E";
                            //PLA_Purchasing_Group.SelectedValue = "";
                            //PLA_Prod_Stor_Loc.Text = PLA_Storage_Location.Text;
                            //PLA_Storage_Loc_For_EP.Text = PLA_Storage_Location.Text;
                            //PLA_MRP_Group.Text = "SEFI";
                            //PLA_Minimum_Lot_Size.Text = "1";
                            //PLA_Maximum_Lot_Size.Text = "60000";
                            //PLA_With_Qty_Struture.SelectedValue = "Y";
                            //PLA_Availability_Check.Text = "Z2";
                            //PLA_Unlimited.Checked = false;
                            //PLA_Individual_Coll.Text = "2";
                            //PLA_SchedMargin_Key.Text = "000";
                            //PLA_Selection_Method.SelectedValue = "3";
                            //PLA_Period_Indicator.Text = "M";

                        }
                    }
                    else if (FORM == "FORM-005" && (TaskAPI.Process == "Sefi Code Application" || TaskAPI.Process == "P-Plant Extend Application" || TaskAPI.Process == "NPL Master Data Application"))
                    {
                        PLA_Availability_Check.Text = "KP";
                        SetEnable(false, PLA_Availability_Check);
                        SetForeColor(Color.Black, PLA_Availability_Check_L, PLA_Tot_repl_lead_time, PLA_Tot_repl_lead_time_L);
                    }
                    else
                    {
                        PLA_Availability_Check.Text = "Z2";
                        PLA_Individual_Coll.Text = "2";
                        PLA_MRP_Group.Text = "SEFI";
                        PLA_Period_Indicator.Text = "M";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Storage_Location.Text = "0200, Semi-Finished";
                        PLA_With_Qty_Struture.SelectedValue = "Y";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_Unlimited.Checked = string.IsNullOrEmpty(PLA_Overdely_Tol.Text);
                        SetEnable(false, PLA_Availability_Check, PLA_Individual_Coll, PLA_MRP_Group, PLA_Period_Indicator, PLA_SchedMargin_Key, PLA_Selection_Method, PLA_Storage_Location, PLA_Unlimited, PLA_With_Qty_Struture, PLA_Prod_Stor_Loc);
                        SetForeColor(Color.Orange, PLA_Availability_Check_L, PLA_Individual_Coll_L, PLA_MRP_Group_L, PLA_Period_Indicator_L, PLA_SchedMargin_Key_L, PLA_Selection_Method_L, PLA_Storage_Location_L, PLA_With_Qty_Struture_L, PLA_Prod_Stor_Loc_L);
                    }
                    break;
                case "FINI":
                case "TRADE":
                    PLA_Period_Indicator.Text = "M";
                    PLA_SchedMargin_Key.Text = "000";
                    //PLA_Individual_Coll.Text                = "2";
                    PLA_Unlimited.Checked = string.IsNullOrEmpty(PLA_Overdely_Tol.Text);

                    if (FORM == "FORM-001")
                    {
                        PLA_With_Qty_Struture.SelectedValue = "N";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZD";
                        PLA_Do_Not_Cost.Checked = true;
                        SetEnable(false, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost);
                        SetForeColor(Color.Orange, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_With_Qty_Struture_L);
                    }

                    if (FORM == "FORM-064" || FORM == "FORM-074")
                    {
                        this.PLA_Plant.SelectedValue = "K51D";
                        this.PLA_Storage_Location.Text = "0010.0035,0050,0060,0070,0090";
                        this.PLA_Availability_Check.Text = "Z1";
                        this.PLA_MRP_Group.Text = "FINI";
                        this.PLA_MRP_Type.Text = "PD";
                        this.PLA_MRP_Controller.Text = "001";
                        this.PLA_Lot_Size.Text = "EX";
                        this.PLA_Procurement_Type.SelectedValue = "F";
                        this.PLA_Period_Indicator.Text = "M";
                        this.PLA_Special_Procurement.SelectedValue = "20";
                        this.PLA_Prod_Stor_Loc.Text = "";
                        this.PLA_Storage_Loc_For_EP.Text = "0010";
                        this.PLA_SchedMargin_Key.Text = "000";

                        if (FORM == "FORM-064")
                        {
                            PLA_Purchasing_Group.SelectedValue = "K03";
                            PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                            PLA_Strategy_Group.SelectedValue = "40";
                            //PLA_Stock_Det_Grp.Text = "0001";
                            //this.PLA_Valuation_Class.Text = "Z005";

                            //SetEnable(false, PLA_Plant_Sp_Matl_Status, PLA_Strategy_Group, PLA_Valuation_Class);
                            //SetForeColor(Color.Orange, PLA_Plant_Sp_Matl_Status_L, PLA_Strategy_Group_L, PLA_Valuation_Class_L);

                            SetEnable(false, PLA_Plant_Sp_Matl_Status, PLA_Strategy_Group);
                            SetForeColor(Color.Orange, PLA_Plant_Sp_Matl_Status_L, PLA_Strategy_Group_L);
                        }

                        if (FORM == "FORM-074")
                        {
                            this.PLA_Purchasing_Group.SelectedValue = "K04";
                            this.PLA_With_Qty_Struture.SelectedValue = "Y";
                            this.PLA_Selection_Method.SelectedValue = "";
                            this.PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                            this.PLA_Strategy_Group.SelectedValue = "40";
                            this.PLA_Forecast_Model.SelectedValue = "N";

                            SetEnable(false, PLA_With_Qty_Struture, PLA_Selection_Method, PLA_Plant_Sp_Matl_Status, PLA_Strategy_Group, PLA_Forecast_Model);
                            SetForeColor(Color.Orange, PLA_With_Qty_Struture_L, PLA_Selection_Method_L, PLA_Plant_Sp_Matl_Status_L, PLA_Strategy_Group_L,
                                                PLA_Forecast_Model_L);
                        }

                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Special_Procurement,
                                     PLA_Procurement_Type, PLA_Purchasing_Group, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Availability_Check,
                                     PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Storage_Loc_For_EP);

                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Special_Procurement_L,
                            PLA_Procurement_Type_L, PLA_Purchasing_Group_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Availability_Check_L,
                            PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Storage_Loc_For_EP_L);
                    }

                    SetEnable(false, PLA_Period_Indicator, PLA_SchedMargin_Key, PLA_Unlimited, PLA_Individual_Coll);
                    SetForeColor(Color.Orange, PLA_Period_Indicator_L, PLA_SchedMargin_Key_L, PLA_Individual_Coll_L);

                    if (FORM == "FORM-065-1")
                    {
                        PLA_Availability_Check.Text = "Z1";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Purchasing_Group.SelectedValue = "K20";

                        SetEnable(false, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group);
                        SetForeColor(Color.Orange, PLA_Availability_Check_L, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L);
                    }

                    if (FORM == "FORM-031-1")
                    {

                        PLA_Plant.SelectedValue = "K15P";
                        PLA_Storage_Location.Text = "K15D";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_MRP_Group.Text = "ATP";
                        PLA_MRP_Type.Text = "M0";
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Prod_Stor_Loc.Text = "K15D";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Group, PLA_Procurement_Type, PLA_Procurement_Type, PLA_Prod_Stor_Loc, PLA_MRP_Type, PLA_Selection_Method, PLA_Individual_Coll, PLA_Plant_Sp_Matl_Status);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Type_L, PLA_Selection_Method_L, PLA_Individual_Coll_L, PLA_Plant_Sp_Matl_Status_L);
                    }
                    if (FORM == "FORM-031-2")
                    {
                        PLA_Plant.SelectedValue = "K15D";
                        PLA_Storage_Location.Text = "0010";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Prod_Stor_Loc.Text = "K15D";
                        PLA_Special_Procurement.SelectedValue = "D1";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_Selection_Method.SelectedValue = "";
                        PLA_Purchasing_Group.SelectedValue = "ZFM";
                        PLA_Forecast_Model.SelectedValue = "N";
                        PLA_Strategy_Group.SelectedValue = "40";
                        PLA_Individual_Coll.Text = "";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Group, PLA_Procurement_Type, PLA_Prod_Stor_Loc, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_Selection_Method, PLA_Purchasing_Group, PLA_Forecast_Model, PLA_Strategy_Group, PLA_Individual_Coll, PLA_Plant_Sp_Matl_Status);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Prod_Stor_Loc_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_Selection_Method_L, PLA_Purchasing_Group_L, PLA_Forecast_Model_L, PLA_Strategy_Group_L, PLA_Individual_Coll_L, PLA_Plant_Sp_Matl_Status_L);
                    }


                    if (FORM == "FORM-014")
                    {
                        PLA_Availability_Check.Text = "Z1";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Purchasing_Group.SelectedValue = "K20";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Controller.Text = "POP";
                        PLA_Lot_Size.Text = "EX";
                        PLA_Prod_Stor_Loc.Text = "0530";
                        PLA_Storage_Loc_For_EP.Text = "0530";
                        PLA_Planned_Delivery_Time.Text = "1";
                        PLA_SchedMargin_Key.Text = "000";
                        SetEnable(false, PLA_Availability_Check, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group, PLA_MRP_Type
                                       , PLA_MRP_Controller, PLA_Lot_Size, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_Planned_Delivery_Time, PLA_SchedMargin_Key);
                        SetForeColor(Color.Orange, PLA_Availability_Check_L, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L, PLA_MRP_Type_L
                                                 , PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_Planned_Delivery_Time_L
                                                 , PLA_SchedMargin_Key_L);
                    }

                    if (FORM == "FORM-067")
                    {
                        PLA_Plant.SelectedValue = "K51D";
                        PLA_Storage_Location.Text = "0010.0035,0050,0060,0070,0090";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Controller.Text = "001";
                        PLA_Lot_Size.Text = "EX";
                        PLA_With_Qty_Struture.SelectedValue = "Y";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_Prod_Stor_Loc.Text = "";
                        PLA_Purchasing_Group.SelectedValue = "K04";
                        PLA_Strategy_Group.SelectedValue = "40";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Special_Procurement.SelectedValue = "20";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller, PLA_Lot_Size
                                       , PLA_With_Qty_Struture, PLA_Period_Indicator, PLA_Procurement_Type, PLA_Storage_Loc_For_EP, PLA_Prod_Stor_Loc, PLA_Purchasing_Group
                                       , PLA_Strategy_Group, PLA_Plant_Sp_Matl_Status, PLA_SchedMargin_Key, PLA_Special_Procurement);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Lot_Size_L
                                                 , PLA_With_Qty_Struture_L, PLA_Period_Indicator_L, PLA_Procurement_Type_L, PLA_Storage_Loc_For_EP_L, PLA_Prod_Stor_Loc_L, PLA_Purchasing_Group_L
                                                 , PLA_Strategy_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_SchedMargin_Key_L, PLA_Special_Procurement_L);
                    }
                    if (FORM == "FORM-015")
                    {
                        PLA_Storage_Location.Text = "0010";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Purchasing_Group.SelectedValue = "K03";
                        SetEnable(false, PLA_Availability_Check, PLA_Purchasing_Group, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status);
                        SetForeColor(Color.Orange, PLA_Purchasing_Group_L, PLA_Availability_Check_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L);
                    }
                    if (FORM == "FORM-062")
                    {
                        PLA_Plant.SelectedValue = "K51D";
                        PLA_Storage_Location.Text = "0010,0035,0050,0060,0070,0090";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Controller.Text = "001";
                        PLA_Lot_Size.Text = "EX";
                        PLA_With_Qty_Struture.SelectedValue = "Y";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Special_Procurement.SelectedValue = "20";
                        PLA_Prod_Stor_Loc.Text = "";
                        PLA_Storage_Location.Text = "0010";
                        PLA_Selection_Method.SelectedValue = "3";
                        PLA_Purchasing_Group.SelectedValue = "K04";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Individual_Coll.Text = "";
                        PLA_Strategy_Group.SelectedValue = "40";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Availability_Check, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller, PLA_Lot_Size, PLA_With_Qty_Struture
                                       , PLA_Period_Indicator, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_Storage_Location, PLA_Selection_Method, PLA_Purchasing_Group
                                       , PLA_Plant_Sp_Matl_Status, PLA_SchedMargin_Key, PLA_Individual_Coll, PLA_Strategy_Group, PLA_Storage_Loc_For_EP);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_With_Qty_Struture_L
                                                 , PLA_Period_Indicator_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Location_L, PLA_Selection_Method_L, PLA_Purchasing_Group_L
                                                 , PLA_Plant_Sp_Matl_Status_L, PLA_SchedMargin_Key_L, PLA_Individual_Coll_L, PLA_Strategy_Group_L, PLA_Storage_Loc_For_EP_L);
                    }
                    if (FORM == "FORM-012" && TaskAPI.Process == "MTO Base Code Application")
                    {
                        //TB 修改内外部的显示状态
                        if (TaskAPI.Step == "Planning")
                        {
                            SetEnable(true, PLA_Special_Procurement1, PLA_Individual_Coll, PLA_Period_Indicator, PLA_SchedMargin_Key, PLA_Unlimited);

                        }
                        else
                        {
                            SetEnable(false, PLA_Special_Procurement1, PLA_Individual_Coll, PLA_Period_Indicator, PLA_SchedMargin_Key, PLA_Unlimited);
                        }
                        SetForeColor(Color.Black, PLA_Special_Procurement1_L);

                        string subline = (Page as PMDC).TabMaterial1.Technical1.TEC_Subline.Text;
                        string please_Select = (Page as PMDC).Distribute.SelectedValue.ToString();
                        //D-Plant Fini-1string plant = (Page as PMDC).TabMaterial1.Planning1.PLA_Plant.SelectedValue.ToString();
                        m_MTO_Planning m_Planning = null;
                        if ((Parent as TabMaterial).Status.Name == "D-Plant Fini")
                        {
                            m_Planning = (m_MTO_Planning.type == "2" & m_MTO_Planning.sub_Line == subline & m_MTO_Planning.please_Select == please_Select).ListFirst<m_MTO_Planning>();

                        }
                        else if ((Parent as TabMaterial).Status.Name == "P-Plant Fini")
                        {
                            m_Planning = (m_MTO_Planning.type == "1" & m_MTO_Planning.sub_Line == subline & m_MTO_Planning.please_Select == please_Select).ListFirst<m_MTO_Planning>();

                        }
                        else if ((Parent as TabMaterial).Status.Name == "D-Plant Fini-1")
                        {
                            m_Planning = (m_MTO_Planning.type == "3" & m_MTO_Planning.sub_Line == subline & m_MTO_Planning.please_Select == please_Select).ListFirst<m_MTO_Planning>();

                        }
                        else
                        {
                            m_Planning = null;
                        }
                        if (m_Planning != null)
                        {

                            PLA_Plant.SelectedValue = m_Planning.Plant;// "K29P";
                            PLA_Storage_Location.Text = m_Planning.Storange_Location;// "0010";
                            PLA_ICD.SelectedValue = m_Planning.ICD;// "N";
                            PLA_MRP_Controller.Text = m_Planning.MRP_Controller;// "EFO";
                            PLA_MRP_Type.Text = m_Planning.MRP_Type;// "M0";
                            PLA_Lot_Size.Text = m_Planning.Lot_Size;// "EX";
                            //PLA_Special_Procurement.SelectedValue = m_Planning.Special_Procurement;// "";
                            PLA_Special_Procurement1.Text = m_Planning.Special_Procurement;
                            PLA_Procurement_Type.SelectedValue = m_Planning.Procurement_Type;// "E";
                            PLA_Purchasing_Group.SelectedValue = m_Planning.Purchasing_Group;// "";
                            PLA_Prod_Stor_Loc.Text = m_Planning.Prod_Stor_Loc;
                            PLA_Storage_Loc_For_EP.Text = m_Planning.Storage_loc_for_EP;
                            PLA_MRP_Group.Text = m_Planning.MRP_Group;// "MTO";
                            PLA_Minimum_Lot_Size.Text = m_Planning.Minimum_Lot_Size;// "";
                            PLA_Maximum_Lot_Size.Text = m_Planning.Maximum_Lot_Size;// "";
                            PLA_With_Qty_Struture.SelectedValue = m_Planning.With_Qty_Stuture;// "Y";
                            PLA_Availability_Check.Text = m_Planning.Availability_Check;// "Z3";
                            PLA_Planning_Material.Text = m_Planning.Planning_Material;// "";
                            PLA_Planning_Matl_BUnit.Text = m_Planning.Planning_matl_Bunit;// "";
                            PLA_Planning_Plant.SelectedValue = m_Planning.Planning_Plant;// "";
                            PLA_Strategy_Group.Text = m_Planning.Strategy_Group;// "";
                            PLA_Plng_Conv_Factor.Text = m_Planning.PIng_Conv_factor;// "";
                            PLA_Plant_Sp_Matl_Status.SelectedValue = m_Planning.Plant_sp_malt_status;


                            PLA_Fix_Lot_Size.Text = m_Planning.Fix_Lot_size;
                            if (m_Planning.Unlimited == "√")
                            {
                                PLA_Unlimited.Checked = true;
                            }
                            else
                            {
                                PLA_Unlimited.Checked = false;
                            }
                            PLA_Overdely_Tol.Text = m_Planning.Overdely_tol;
                            PLA_Rounding_Value.Text = m_Planning.Rounding_value;
                            PLA_GR_Processing_Time.Text = m_Planning.GR_Processing_Time;
                            PLA_In_house_Production_Time.Text = m_Planning.In_house_production;
                            PLA_Planned_Delivery_Time.Text = m_Planning.Planned_delivery_time;
                            PLA_Safety_Time_Act_Cov.Text = m_Planning.Safety_time_act_cov;
                            PLA_Safty_Stock.Text = m_Planning.Safety_Stock;
                            PLA_Safety_Time_Ind.Text = m_Planning.Safety_time_ind;
                            PLA_ABC_Indicator.SelectedValue = m_Planning.ABC_Indicator;
                            PLA_Individual_Coll.Text = m_Planning.Individual_coll;
                            PLA_SchedMargin_Key.Text = m_Planning.SchedMargin_key;
                            PLA_Selection_Method.SelectedValue = m_Planning.Selection_method;
                            PLA_Period_Indicator.Text = m_Planning.Period_Indicator;
                            PLA_Forecast_Model.Text = m_Planning.Forecast_model;
                            PLA_Consumption_Mode.SelectedValue = m_Planning.Consumption_mode;
                            PLA_Bwd_Comsumption.Text = m_Planning.Bwd_consumption_per;
                            PLA_Fwd_Comsumption.Text = m_Planning.Fwd_consumption_per;
                            PLA_Tot_repl_lead_time.Text = m_Planning.Tot_repl_lead_time;
                        }

                    }
                    if (FORM == "FORM-T009")
                    {
                        PLA_Plant.SelectedValue = "KT1D";
                        PLA_Storage_Location.Text = "0010 0035 0060 0090";
                        PLA_Purchasing_Group.SelectedValue = "K03";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_MRP_Type.Text = "Z1";
                        PLA_MRP_Controller.Text = "TRD";
                        PLA_Lot_Size.Text = "EX";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Special_Procurement.SelectedValue = "20";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Strategy_Group.SelectedValue = "40";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_Forecast_Model.SelectedValue = "N";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Source_List.Checked = true;
                        SetEnable(false, PLA_Plant, PLA_Storage_Location, PLA_Purchasing_Group, PLA_Plant_Sp_Matl_Status, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller
                                       , PLA_Lot_Size, PLA_Storage_Loc_For_EP, PLA_Procurement_Type, PLA_Special_Procurement, PLA_SchedMargin_Key, PLA_Strategy_Group, PLA_Availability_Check
                                       , PLA_Forecast_Model, PLA_Period_Indicator, PLA_Source_List);
                        SetForeColor(Color.Orange, PLA_Plant_L, PLA_Storage_Location_L, PLA_Purchasing_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L
                                       , PLA_Lot_Size_L, PLA_Storage_Loc_For_EP_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_SchedMargin_Key_L, PLA_Strategy_Group_L, PLA_Availability_Check_L
                                       , PLA_Forecast_Model_L, PLA_Period_Indicator_L, PLA_Source_List_L);

                    }
                    if (FORM == "FORM-T012")
                    {
                        PLA_Plant.SelectedValue = "KT2D";
                        PLA_Storage_Location.Text = "0010 0035 0060 0090";
                        PLA_Purchasing_Group.SelectedValue = "K03";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_MRP_Type.Text = "Z1";
                        PLA_MRP_Controller.Text = "TRD";
                        PLA_Lot_Size.Text = "EX";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Special_Procurement.SelectedValue = "20";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Strategy_Group.SelectedValue = "40";
                        PLA_Availability_Check.Text = "Z1";
                        PLA_Forecast_Model.SelectedValue = "N";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Source_List.Checked = true;
                        PLA_Planned_Delivery_Time.Text = "60";
                        SetEnable(false, PLA_Source_List, PLA_Plant, PLA_Storage_Location, PLA_Purchasing_Group, PLA_Plant_Sp_Matl_Status, PLA_MRP_Group, PLA_MRP_Type, PLA_MRP_Controller
                                       , PLA_Lot_Size, PLA_Storage_Loc_For_EP, PLA_Procurement_Type, PLA_Special_Procurement, PLA_SchedMargin_Key, PLA_Strategy_Group, PLA_Availability_Check
                                       , PLA_Forecast_Model, PLA_Period_Indicator, PLA_Planned_Delivery_Time);
                        SetForeColor(Color.Orange, PLA_Source_List_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_Purchasing_Group_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_MRP_Type_L, PLA_MRP_Controller_L
                                       , PLA_Lot_Size_L, PLA_Storage_Loc_For_EP_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_SchedMargin_Key_L, PLA_Strategy_Group_L, PLA_Availability_Check_L
                                       , PLA_Forecast_Model_L, PLA_Period_Indicator_L, PLA_Planned_Delivery_Time_L);

                    }
                    if (FORM == "FORM-T006")
                    {

                        PLA_Plant_1.SelectedValue = "KT1P";
                        PLA_Storage_Location_1.Text = "KT1D 0035 0060";
                        PLA_Plant_Sp_Matl_Status_1.SelectedValue = "ZG";
                        PLA_MRP_Group_1.Text = "MTO";
                        PLA_MRP_Type_1.Text = "M0";
                        PLA_MRP_Controller_1.Text = "EFO";
                        PLA_Lot_Size_1.Text = "EX";
                        PLA_Storage_Loc_For_EP_1.Text = "KT1D";
                        PLA_Procurement_Type_1.SelectedValue = "E";
                        PLA_GR_Processing_Time_1.Text = "0";
                        PLA_SchedMargin_Key_1.Text = "000";
                        PLA_Availability_Check_1.Text = "KP";
                        PLA_Period_Indicator_1.Text = "M";
                        PLA_Selection_Method_1.Text = "3";
                        PLA_Unlimited_1.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        PLA_Plant.SelectedValue = "KT1D";
                        PLA_Storage_Location.Text = "0010 0035 0060 0070 0080 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Purchasing_Group.SelectedValue = "ZFM";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_Lot_Size.Text = "EX";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_MRP_Controller.Text = "EFO";
                        PLA_Special_Procurement.SelectedValue = "W1";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_GR_Processing_Time.Text = "0";
                        PLA_Planned_Delivery_Time.Text = "1";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Strategy_Group.SelectedValue = "99";
                        PLA_Availability_Check.Text = "Z3";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Forecast_Model.SelectedValue = "";
                        PLA_In_house_Production_Time_1.Text = "1";
                        SetEnable(false, PLA_Plant_1, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type, PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Procurement_Type_1
                                       , PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Availability_Check_1, PLA_Period_Indicator_1
                                       , PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group
                                       , PLA_MRP_Type, PLA_MRP_Group, PLA_Lot_Size, PLA_Procurement_Type, PLA_MRP_Controller, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_MRP_Type_1
                                       , PLA_GR_Processing_Time, PLA_Planned_Delivery_Time, PLA_SchedMargin_Key, PLA_Strategy_Group, PLA_Availability_Check, PLA_Period_Indicator, PLA_Forecast_Model, PLA_In_house_Production_Time_1);
                        SetForeColor(Color.Orange, PLA_Plant_1_L, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1_L, PLA_MRP_Type_L, PLA_MRP_Controller_1_L, PLA_Lot_Size_1_L, PLA_Procurement_Type_1_L
                                       , PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_L, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1_L, PLA_Availability_Check_1_L, PLA_Period_Indicator_1_L
                                       , PLA_Selection_Method_1_L, PLA_Unlimited_1_L, PLA_Product_Scheduling_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L
                                       , PLA_MRP_Type_L, PLA_MRP_Group_L, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_MRP_Controller_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L
                                       , PLA_GR_Processing_Time_L, PLA_Planned_Delivery_Time_L, PLA_SchedMargin_Key_L, PLA_Strategy_Group_L, PLA_Availability_Check_L, PLA_Period_Indicator_L, PLA_Forecast_Model_L, PLA_MRP_Type_1_L, PLA_In_house_Production_Time_1_L);
                    }
                    if (FORM == "FORM-T010")
                    {
                        PLA_Plant_1.SelectedValue = "KT2P";
                        PLA_Storage_Location_1.Text = "KT2D 0035 0060";
                        PLA_Plant_Sp_Matl_Status_1.SelectedValue = "ZG";
                        PLA_MRP_Group_1.Text = "MTO";
                        PLA_MRP_Type_1.Text = "M0";
                        PLA_MRP_Controller_1.Text = "EFO";
                        PLA_Lot_Size_1.Text = "EX";
                        PLA_Storage_Loc_For_EP_1.Text = "KT2D";
                        PLA_Procurement_Type_1.SelectedValue = "E";
                        PLA_GR_Processing_Time_1.Text = "0";
                        PLA_SchedMargin_Key_1.Text = "000";
                        //PLA_Availability_Check_1.Text = "KP";
                        PLA_Period_Indicator_1.Text = "M";
                        PLA_Selection_Method_1.Text = "3";
                        PLA_Unlimited_1.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        PLA_Plant.SelectedValue = "KT2D";
                        PLA_Storage_Location.Text = "0010 0035 0060 0070 0080 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Purchasing_Group.SelectedValue = "ZFM";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_Lot_Size.Text = "EX";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_MRP_Controller.Text = "EFO";
                        PLA_Special_Procurement.SelectedValue = "W2";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_GR_Processing_Time.Text = "1";
                        //PLA_Planned_Delivery_Time.Text = "0";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Strategy_Group.SelectedValue = "99";
                        PLA_Availability_Check.Text = "Z3";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Forecast_Model.SelectedValue = "0";

                        if (TaskAPI.Process == "TW MTO Application-PKG" && TaskAPI.Step == "Planning")
                        {
                            SetEnable(true, PLA_Planned_Delivery_Time);
                            SetForeColor(Color.Black, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L);
                        }
                        SetEnable(false, PLA_Plant_1, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_MRP_Group_1, PLA_MRP_Type_1
                                       , PLA_MRP_Controller_1, PLA_Lot_Size_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type, PLA_GR_Processing_Time_1
                                       , PLA_SchedMargin_Key_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1
                                       , PLA_Product_Scheduling, PLA_Plant, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group
                                       , PLA_MRP_Type, PLA_MRP_Group, PLA_Lot_Size, PLA_Procurement_Type, PLA_MRP_Controller, PLA_Special_Procurement
                                       , PLA_MRP_Controller, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_GR_Processing_Time
                                       , PLA_SchedMargin_Key, PLA_Strategy_Group, PLA_Availability_Check, PLA_Period_Indicator, PLA_Forecast_Model);
                        SetForeColor(Color.Orange, PLA_Plant_1_L, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1_L, PLA_MRP_Group_1_L, PLA_MRP_Type_1_L
                                                 , PLA_MRP_Controller_1_L, PLA_Lot_Size_1_L, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1_L, PLA_GR_Processing_Time_1_L
                                                 , PLA_SchedMargin_Key_1_L, PLA_Period_Indicator_1_L, PLA_Selection_Method_1_L, PLA_Unlimited_1_L
                                                 , PLA_Product_Scheduling_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L
                                                 , PLA_MRP_Type_L, PLA_MRP_Group_L, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_MRP_Controller_L, PLA_Special_Procurement_L
                                                 , PLA_MRP_Controller_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_GR_Processing_Time_L
                                                 , PLA_SchedMargin_Key_L, PLA_Strategy_Group_L, PLA_Availability_Check_L, PLA_Period_Indicator_L, PLA_Forecast_Model_L);
                    }
                    if (FORM == "FORM-TW-010")
                    {
                        //PLA_Plant.Items.Clear();
                        //Tang bin
                        PLA_GR_Processing_Time.Text = "1";

                        PLA_Plant_1.SelectedValue = "KT2P";
                        PLA_Storage_Location_1.Text = "KT2D 0035 0060";
                        PLA_Plant_Sp_Matl_Status_1.Text = "ZG";
                        //PLA_MRP_Group_1.Text = "";
                        //PLA_MRP_Type_1.Text = "M0";
                        //PLA_MRP_Controller_1.Text = "";
                        //PLA_Lot_Size_1.Text = "";
                        PLA_Storage_Loc_For_EP_1.Text = "KT2D";
                        PLA_Procurement_Type_1.Text = "E";
                        //PLA_In_house_Production_Time_1.Text = "";
                        PLA_GR_Processing_Time_1.Text = "0";
                        PLA_SchedMargin_Key_1.Text = "000";
                        PLA_Period_Indicator_1.Text = "M";
                        PLA_Selection_Method_1.Text = "3";
                        PLA_Unlimited_1.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        PLA_MRP_Controller_1.Text = "EFP";
                        PLA_MRP_Group_1.Text = "ATP";
                        if (TaskAPI.Process == "TW NPL Application-PKG")
                        {
                            PLA_Planned_Delivery_Time.Text = "0";
                            SetForeColor(Color.Blue, PLA_Availability_Check_1_L);
                            SetEnable(true, PLA_Availability_Check);
                        }
                        //else
                        //{
                        //    PLA_Availability_Check_1.Text = "KP";
                        //    SetForeColor(Color.Orange, PLA_Availability_Check_1_L);
                        //    SetEnable(false, PLA_Availability_Check_1);
                        //}

                        SetForeColor(Color.Orange, PLA_MRP_Group_1_L, PLA_MRP_Controller_1_L, PLA_Plant_1_L, PLA_Storage_Location_1_L, PLA_Plant_Sp_Matl_Status_1_L, PLA_Storage_Loc_For_EP_1_L, PLA_Procurement_Type_1_L, PLA_GR_Processing_Time_1_L, PLA_SchedMargin_Key_1_L, PLA_Period_Indicator_1_L, PLA_Selection_Method_1_L, PLA_Unlimited_1_L, PLA_Product_Scheduling_L);
                        SetForeColor(Color.Black, PLA_Planned_Delivery_Time, PLA_Planned_Delivery_Time_L);
                        SetEnable(false, PLA_Plant_1, PLA_MRP_Controller_1, PLA_MRP_Group_1, PLA_Storage_Location_1, PLA_Plant_Sp_Matl_Status_1, PLA_Storage_Loc_For_EP_1, PLA_Procurement_Type_1, PLA_GR_Processing_Time_1, PLA_SchedMargin_Key_1, PLA_Period_Indicator_1, PLA_Selection_Method_1, PLA_Unlimited_1, PLA_Product_Scheduling);

                        PLA_Plant.SelectedValue = "KT2D";
                        PLA_Storage_Location.Text = "0010 0035 0060 0070 0080 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Purchasing_Group.SelectedValue = "ZFM";
                        PLA_MRP_Group.Text = "FINI";
                        PLA_Procurement_Type.SelectedValue = "F";
                        //PLA_MRP_Type.Text = "Z1";
                        PLA_MRP_Controller.Text = "EFP";
                        PLA_Special_Procurement.SelectedValue = "W2";
                        PLA_Storage_Loc_For_EP.Text = "0010";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Strategy_Group.SelectedValue = "40";
                        PLA_Consumption_Mode.SelectedValue = "2";
                        PLA_Safety_Time_Act_Cov_L.Text = "Safety time ";
                        PLA_Fwd_Comsumption.Text = "15";
                        PLA_Bwd_Comsumption.Text = "15";
                        PLA_Forecast_Model.SelectedValue = "N";
                        if (TaskAPI.Process == "TW NPL Application-PKG")
                        {
                            PLA_Availability_Check.Text = "Z1";
                            SetForeColor(Color.Orange, PLA_Availability_Check_L);
                            SetEnable(false, PLA_Availability_Check);
                        }

                        SetForeColor(Color.Orange, PLA_Forecast_Model_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Consumption_Mode_L, PLA_Strategy_Group_L, PLA_MRP_Controller_L, PLA_Consumption_Mode_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_Purchasing_Group_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_GR_Processing_Time_L, PLA_Planned_Delivery_Time_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L);
                        SetEnable(false, PLA_Plant, PLA_Forecast_Model, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Consumption_Mode, PLA_Strategy_Group, PLA_MRP_Controller, PLA_Consumption_Mode, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group, PLA_MRP_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_GR_Processing_Time, PLA_Planned_Delivery_Time, PLA_SchedMargin_Key, PLA_Period_Indicator);
                        if (TaskAPI.Process == "TW FINI Code Application")
                        {
                            if ((Page as PMDC).Actions.SelectedValue == "Extend")
                            {
                                SetForeColor(Color.Blue, PLA_Availability_Check_1_L);
                                SetForeColor(Color.Black, PLA_Availability_Check_1);
                            }
                            else
                            {
                                SetForeColor(Color.Black, PLA_Availability_Check_1_L);
                            }
                        }
                    }
                    if (FORM == "FORM-TW-011")
                    {

                        PLA_Plant.SelectedValue = "KT2P";
                        PLA_Storage_Location.Text = "0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_MRP_Group.Text = "SEFI";
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Storage_Loc_For_EP.Text = "0200";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Selection_Method.Text = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        if ((Page as PMDC).TabMaterial2.Technical1.TEC_Top_Sefi.SelectedValue == "Y")
                        {
                            //PLA_MRP_Type.Text = "M0";
                            PLA_MRP_Controller.Text = "ESP";
                        }
                        else
                        {
                            //PLA_MRP_Type.Text = "PD";
                            PLA_MRP_Controller.Text = "ESL";
                        }
                        SetForeColor(Color.Orange, PLA_Prod_Stor_Loc_L, PLA_MRP_Controller_L, PLA_Product_Scheduling_L, PLA_Unlimited_L, PLA_Individual_Coll_L, PLA_Selection_Method_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L);

                        SetEnable(false, PLA_Prod_Stor_Loc, PLA_MRP_Controller, PLA_Product_Scheduling, PLA_Unlimited, PLA_Individual_Coll, PLA_Selection_Method, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group, PLA_MRP_Group, PLA_Procurement_Type, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator);
                    }
                    if (FORM == "FORM-TW-004")
                    {
                        PLA_Title.Text = "";
                        if (TaskAPI.Process == "TW NPL Application-DECO")
                        {
                            PLA_Plant.SelectedValue = "KT1P";
                            SetForeColor(Color.Orange, PLA_Plant_L);
                            SetEnable(false, PLA_Plant);
                        }
                        if (TaskAPI.Process == "TW NPL Application-PKG")
                        {
                            PLA_Plant.SelectedValue = "KT2P";
                            SetForeColor(Color.Orange, PLA_Plant_L);
                            SetEnable(false, PLA_Plant);
                        }
                        PLA_Planned_Delivery_Time_L.Text = "Planned delivery time(days)";
                        PLA_Purchasing_Group.SelectedValue = "K02";
                        PLA_Source_List.Checked = true;
                        PLA_Storage_Location.Text = "0150";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Prod_Stor_Loc.Text = "0150";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Controller.Text = "EPP";
                        PLA_Lot_Size.Text = "05";
                        PLA_Backflush.Text = "1";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Storage_Loc_For_EP.Text = "0150";
                        PLA_SchedMargin_Key.Text = "002";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Availability_Check.Text = "Z1";
                        SetForeColor(Color.Orange, PLA_Availability_Check_L, PLA_Stock_Det_Grp_L, PLA_Backflush_L, PLA_Storage_Loc_For_EP_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_MRP_Type_L, PLA_Source_List_L, PLA_Purchasing_Group_L, PLA_Prod_Stor_Loc_L, PLA_Product_Scheduling_L, PLA_Unlimited_L, PLA_Individual_Coll_L, PLA_Selection_Method_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L);

                        SetEnable(false, PLA_MRP_Controller, PLA_Availability_Check, PLA_Backflush, PLA_Lot_Size, PLA_MRP_Type, PLA_Source_List, PLA_Purchasing_Group, PLA_Prod_Stor_Loc, PLA_Product_Scheduling, PLA_Unlimited, PLA_Individual_Coll, PLA_Selection_Method, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group, PLA_MRP_Group, PLA_Procurement_Type, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator);
                    }
                    if (FORM == "FORM-TW-007-1")
                    {

                        PLA_Fwd_Comsumption_L.Text = "Unit of issue";
                        PLA_Fwd_Comsumption.Text = "L";
                        PLA_Plant.SelectedValue = "KT1P";
                        PLA_Storage_Location.Text = "0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_Prod_Stor_Loc.Text = "0200";
                        PLA_MRP_Group.Text = "SEFI";
                        PLA_Procurement_Type.SelectedValue = "E";
                        PLA_Storage_Loc_For_EP.Text = "0200";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Selection_Method.Text = "3";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Unlimited.Checked = true;
                        PLA_Product_Scheduling.Text = "Z00001";
                        PLA_MRP_Type.Text = "";
                        if ((Page as PMDC).TabMaterial2.Technical1.TEC_Top_Sefi.SelectedValue == "Y")
                        {
                            PLA_MRP_Controller.Text = "ESP";
                        }
                        else
                        {
                            PLA_MRP_Controller.Text = "ESL";
                        }
                        SetForeColor(Color.Orange, PLA_MRP_Controller_L, PLA_Fwd_Comsumption_L, PLA_Prod_Stor_Loc_L, PLA_Product_Scheduling_L, PLA_Unlimited_L, PLA_Individual_Coll_L, PLA_Selection_Method_L, PLA_Plant_L, PLA_Storage_Location_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Storage_Loc_For_EP_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L);
                        SetForeColor(Color.Blue, PLA_MRP_Type_L);
                        SetForeColor(Color.Black, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L);
                        SetEnable(false, PLA_MRP_Controller, PLA_Fwd_Comsumption, PLA_Prod_Stor_Loc, PLA_Product_Scheduling, PLA_Unlimited, PLA_Individual_Coll, PLA_Selection_Method, PLA_Plant, PLA_Storage_Location, PLA_Plant_Sp_Matl_Status, PLA_Purchasing_Group, PLA_MRP_Group, PLA_Procurement_Type, PLA_Storage_Loc_For_EP, PLA_SchedMargin_Key, PLA_Period_Indicator);

                    }
                    if (FORM == "FORM-TW-007")
                    {
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Controller.Text = "EFP";
                        PLA_GR_Processing_Time.Text = "0";
                        PLA_SchedMargin_Key.Text = "000";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Purchasing_Group.SelectedValue = "";
                        if (TaskAPI.Process == "TW NPL Application-DECO")
                        {
                            SetForeColor(Color.Blue, PLA_MRP_Type_L);
                            PLA_Availability_Check.Text = "Z1";
                            SetForeColor(Color.Orange, PLA_Availability_Check_L);
                            SetEnable(false, PLA_Availability_Check);
                        }
                        SetForeColor(Color.Black, PLA_Production_Planner_L, PLA_SNP_Planner_L, PLA_Safety_Stock_Method_L);
                        SetForeColor(Color.Orange, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Controller_L, PLA_GR_Processing_Time_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L);
                        SetEnable(false, PLA_Plant_Sp_Matl_Status, PLA_MRP_Controller, PLA_GR_Processing_Time, PLA_SchedMargin_Key, PLA_Period_Indicator);

                        SetForeColor(Color.Orange, PLA_Storage_Location_L, PLA_Purchasing_Group_L, PLA_MRP_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Storage_Loc_For_EP_L, PLA_Planned_Delivery_Time_L, PLA_Strategy_Group_L, PLA_Consumption_Mode_L, PLA_Fwd_Comsumption_L, PLA_Bwd_Comsumption_L, PLA_Forecast_Model_L, PLA_Unlimited_L, PLA_Selection_Method_L, PLA_Product_Scheduling_L);
                        SetEnable(false, PLA_Storage_Location, PLA_Purchasing_Group, PLA_MRP_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Storage_Loc_For_EP, PLA_Planned_Delivery_Time, PLA_Strategy_Group, PLA_Consumption_Mode, PLA_Fwd_Comsumption, PLA_Bwd_Comsumption, PLA_Forecast_Model, PLA_Unlimited, PLA_Selection_Method, PLA_Product_Scheduling);

                    }
                    if (FORM == "FORM-T003")
                    {
                        PLA_Purchasing_Group.SelectedValue = "K01";
                        PLA_Source_List.Checked = true;
                        PLA_Plant_Sp_Matl_Status.SelectedValue = "ZG";
                        PLA_MRP_Type.Text = "PD";
                        PLA_MRP_Controller.Text = "ERP";
                        PLA_Lot_Size.Text = "05";
                        PLA_Procurement_Type.SelectedValue = "F";
                        PLA_Backflush.Text = "1";
                        PLA_SchedMargin_Key.Text = "010";
                        PLA_Period_Indicator.Text = "M";
                        PLA_Individual_Coll.Text = "2";
                        PLA_Availability_Check.Text = "Z1";
                        if ((Page as PMDC).Distribute.SelectedValue == "DECO")
                        {
                            PLA_Plant.SelectedValue = "KT1P";
                        }
                        else if ((Page as PMDC).Distribute.SelectedValue == "PKG")
                        {
                            (Page as PMDC).TabMaterial1.Planning1.PLA_Plant.SelectedValue = "KT2P";
                        }
                        else
                        {
                            (Page as PMDC).TabMaterial1.Planning1.PLA_Plant.SelectedValue = "";
                        }
                        SetEnable(false, PLA_Purchasing_Group, PLA_Source_List, PLA_Plant_Sp_Matl_Status, PLA_MRP_Type, PLA_MRP_Controller, PLA_Lot_Size, PLA_Procurement_Type, PLA_Backflush, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Individual_Coll, PLA_Prod_Stor_Loc, PLA_Storage_Loc_For_EP, PLA_Plant, PLA_Availability_Check);
                        SetForeColor(Color.Orange, PLA_Purchasing_Group_L, PLA_Source_List_L, PLA_Plant_Sp_Matl_Status_L, PLA_MRP_Type_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_Procurement_Type_L, PLA_Backflush_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Individual_Coll_L, PLA_Prod_Stor_Loc_L, PLA_Storage_Loc_For_EP_L, PLA_Plant_L, PLA_Availability_Check_L);
                    }
                    break;

            }
        }
        #endregion

        #region 方法 SetToolTip(设置控件 ToolTip)
        public void SetToolTip()
        {
            switch (Category)
            {
                case "RAW":
                    PLA_ABC_Indicator.ToolTip = "ABC标识";
                    PLA_Availability_Check.ToolTip = "可用性检查的检查组(默认为Z1: DCE stock item)";
                    PLA_Backflush.ToolTip = "标识反冲(默认为1: Always backflush)";
                    PLA_GR_Processing_Time.ToolTip = "以天计的收货处理时间";
                    PLA_Individual_Coll.ToolTip = "对于独立和集中需求的相关需求标识(默认为2: Collective requirements only)";
                    PLA_Lot_Size.ToolTip = "批量";
                    PLA_MRP_Controller.ToolTip = "MRP 控制者";
                    PLA_MRP_Type.ToolTip = "物料需求计划类型(默认为PD: MRP)";
                    PLA_Period_Indicator.ToolTip = "期间标识(默认为M: Monthly)";
                    PLA_Plant_Sp_Matl_Status.ToolTip = "工厂特定的物料状态(默认为ZG: General available)";
                    PLA_Procurement_Type.ToolTip = "采购类型(默认为F 外部获取)";
                    PLA_Prod_Stor_Loc.ToolTip = "发货库存地点";
                    PLA_Safty_Stock.ToolTip = "安全库存(不与安全时间同时使用)";
                    PLA_Safety_Time_Ind.ToolTip = "安全时间标识(与安全库存同时使用)";
                    PLA_Safety_Time_Act_Cov.ToolTip = "安全时间(不与安全库存同时使用)(天)";
                    PLA_SchedMargin_Key.ToolTip = "浮动的计划边际码(默认为010)";
                    PLA_With_Qty_Struture.ToolTip = "物料根据数量结构进行成本核算";
                    PLA_Storage_Loc_For_EP.ToolTip = "外部采购缺省仓储位置";
                    PLA_Stock_Det_Grp.ToolTip = "库存确定组";
                    if (FORM == "FORM-T003" || FORM == "FORM-T018")
                    {
                        PLA_Plant.ToolTip = "需要擴展的生産工廠";
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位 必填";
                        PLA_Purchasing_Group.ToolTip = "採購組 默認爲K01";
                        PLA_Source_List.ToolTip = "標識：源清單要求 默認打勾";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態 默認爲ZG";
                        PLA_ABC_Indicator.ToolTip = "ABC標識";
                        PLA_MRP_Type.ToolTip = "物料需求計劃類型 默認為PD";
                        PLA_MRP_Controller.ToolTip = "MRP控製者（物料計劃人） 默認爲ERP";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃） 默認爲05";
                        PLA_Minimum_Lot_Size.ToolTip = "最小批量";
                        PLA_Procurement_Type.ToolTip = "采購類型 默認爲F";
                        PLA_Maximum_Lot_Size.ToolTip = "最大批量";
                        PLA_Special_Procurement.ToolTip = "特殊采購類型 必填";
                        PLA_Rounding_Value.ToolTip = "采購訂單數量的舍入值";
                        PLA_Backflush.ToolTip = "標識：反衝 默認爲1";
                        PLA_Prod_Stor_Loc.ToolTip = "發貨庫存地點 同Storage Location";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼 默認爲010";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部采購的缺省倉儲位置 同Storage Location";
                        PLA_Planned_Delivery_Time.ToolTip = "計劃的天數內交貨";
                        PLA_Stock_Det_Grp.ToolTip = "庫存確定組 SPT爲10時，默認爲0001";
                        PLA_Safty_Stock.ToolTip = "安全庫存";
                        PLA_Safety_Time_Ind.ToolTip = "安全時間標識（含或不含安全時間）";
                        PLA_Availability_Check.ToolTip = "可用性檢查的檢查組 必填";
                        PLA_Safety_Time_Act_Cov.ToolTip = "安全時間（按工作日計算）";
                        PLA_Period_Indicator.ToolTip = "期間標識 默認爲M";
                        PLA_Individual_Coll.ToolTip = "對于獨立和集中需求的相關需求標識 默認爲2";
                        PLA_PO_Price.ToolTip = "采購價格";
                    }
                    break;
                case "PACK":
                    PLA_ABC_Indicator.ToolTip = "ABC标识";
                    PLA_Availability_Check.ToolTip = "可用性检查的检查组(默认为Z1: DCE stock item)";
                    PLA_Backflush.ToolTip = "标识反冲(默认为1: Always backflush)";
                    PLA_Fix_Lot_Size.ToolTip = "固定批量值";
                    PLA_GR_Processing_Time.ToolTip = "以天计的收货处理时间";
                    PLA_Individual_Coll.ToolTip = "对于独立和集中需求的相关需求标识(默认为2: Collective requirements only)";
                    PLA_Lot_Size.ToolTip = "批量(默认为EX)";
                    PLA_Maximum_Lot_Size.ToolTip = "最大批量值";
                    PLA_Minimum_Lot_Size.ToolTip = "最小批量值";
                    PLA_MRP_Controller.ToolTip = "MRP 控制者";
                    PLA_MRP_Type.ToolTip = "物料需求计划类型(默认为PD: MRP)";
                    PLA_Period_Indicator.ToolTip = "期间标识(默认为M: Monthly)";
                    PLA_Planned_Delivery_Time.ToolTip = "计划内的交货时间(天)";
                    PLA_Plant.ToolTip = "仅存在P-plant";
                    PLA_Procurement_Type.ToolTip = "采购类型(默认为F 外部获取)";
                    PLA_Prod_Stor_Loc.ToolTip = "发货库存地点";
                    PLA_Rounding_Value.ToolTip = "采购订单数量的舍入值";
                    PLA_Safty_Stock.ToolTip = "安全库存(不与安全时间同时使用)";
                    PLA_Safety_Time_Ind.ToolTip = "安全时间标识(与安全库存同时使用)";
                    PLA_Safety_Time_Act_Cov.ToolTip = "安全时间(不与安全库存同时使用)(天)";
                    PLA_SchedMargin_Key.ToolTip = "浮动的计划边际码(默认为002)";
                    PLA_Special_Procurement.ToolTip = "特殊获取类型(默认为20: External procurement)";
                    PLA_Storage_Location.ToolTip = "需要扩展的仓位(默认为0150: Raw Mat. Packg)";
                    PLA_With_Qty_Struture.ToolTip = "物料根据数量结构进行成本核算";
                    PLA_Storage_Loc_For_EP.ToolTip = "外部采购缺省仓储位置";
                    PLA_Stock_Det_Grp.ToolTip = "库存确定组";
                    PLA_In_house_Production_Time.ToolTip = "厂内生产时间(天)";
                    break;
                case "SEFI":
                    PLA_Plant.ToolTip = "需要扩展的工厂(仅存在 P-Plant,请参考 CRM0001)";
                    PLA_ABC_Indicator.ToolTip = "ABC标识";
                    PLA_Availability_Check.ToolTip = "可用性检查的检查组(默认为KP:SEFI/MAPA)";
                    PLA_Do_Not_Cost.ToolTip = "无成本核算(Y: 不参与成本核算 N: 参与成本核算)";
                    PLA_Fix_Lot_Size.ToolTip = "固定批量值";
                    PLA_Individual_Coll.ToolTip = "对于独立和集中需求的相关需求标识(默认为2: Collective requirements only)";
                    PLA_In_house_Production_Time.ToolTip = "厂内生产时间(天)";
                    PLA_Lot_Size.ToolTip = "批量";
                    PLA_Maximum_Lot_Size.ToolTip = "最大批量值";
                    PLA_Minimum_Lot_Size.ToolTip = "最小批量值";
                    PLA_MRP_Controller.ToolTip = "MRP 控制者";
                    PLA_MRP_Group.ToolTip = "物料需求计划组(默认为SEFI)";
                    PLA_MRP_Type.ToolTip = "物料需求计划类型";
                    PLA_Period_Indicator.ToolTip = "期间标识(默认为M: Monthly)";
                    PLA_Planned_Delivery_Time.ToolTip = "计划内的交货时间(天)";
                    PLA_Plant.ToolTip = "需要扩展的工厂(仅存在P-Plant)";
                    PLA_Plant_Sp_Matl_Status.ToolTip = "工厂物料状态";
                    PLA_Procurement_Type.ToolTip = "采购类型(默认为 E, 内部生产)";
                    PLA_Prod_Stor_Loc.ToolTip = "发货库存地点";
                    PLA_Rounding_Value.ToolTip = "采购订单数量的舍入值";
                    PLA_Safty_Stock.ToolTip = "安全库存(不与安全时间同时使用)";
                    PLA_Safety_Time_Ind.ToolTip = "安全时间标识(与安全库存同时使用)";
                    PLA_Safety_Time_Act_Cov.ToolTip = "安全时间(不与安全库存同时使用)(天)";
                    PLA_SchedMargin_Key.ToolTip = "浮动的计划边际码(默认为000)";
                    PLA_Selection_Method.ToolTip = "选择可替换物料单的方法(默认为3: Seletion only by production version)";
                    PLA_Special_Procurement.ToolTip = "特殊获取类型";
                    PLA_Storage_Location.ToolTip = "需要扩展的仓位(默认0200: Semi Finished)";
                    PLA_Unlimited.ToolTip = "勾选Unlimited(为可选, 与Overdely tol.不能同时填写)";
                    PLA_With_Qty_Struture.ToolTip = "物料根据数量结构进行成本核算";
                    PLA_Unlimited.ToolTip = "勾选Unlimited（若Overdely tol.不填则勾）";
                    PLA_Overdely_Tol.ToolTip = "超量交货容差限制";
                    PLA_GR_Processing_Time.ToolTip = "以天计的收货处理时间";
                    PLA_With_Qty_Struture.ToolTip = "With Qty Struture(Y/N)(默认为 Y)";
                    PLA_Consumption_Mode.ToolTip = "消耗模式";
                    PLA_Bwd_Comsumption.ToolTip = "向后消耗期间";
                    PLA_Fwd_Comsumption.ToolTip = "向前消耗期间";
                    PLA_Lot_Size.ToolTip = "当“Lot Size”为 FX 时必填";
                    if (FORM == "FORM-T008")
                    {
                        PLA_Plant.ToolTip = "需要擴展的生産工廠 DECO的默認為KT1P";
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位 默認為0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態 MTO創建時爲ZF，MTS創建時爲ZC,最後都爲ZG";
                        PLA_MRP_Group.ToolTip = "物料需求計劃組 默认为SEFI";
                        PLA_MRP_Type.ToolTip = "物料需求計劃類型 Top Sefi默認為M0, Low Sefi默認為PD";
                        PLA_MRP_Controller.ToolTip = "MRP控製者（物料計劃人） Top Sefi:ESP,Low Sefi:ESL";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃）";
                        PLA_Minimum_Lot_Size.ToolTip = "最小批量";
                        PLA_Maximum_Lot_Size.ToolTip = "最大批量";
                        PLA_Fix_Lot_Size.ToolTip = "固定批量大小 若Lot Size爲FX則必填";
                        PLA_Procurement_Type.ToolTip = "采購類型 默認為E";
                        PLA_Prod_Stor_Loc.ToolTip = "髮貨庫存地點 默認為0200";
                        PLA_In_house_Production_Time.ToolTip = "場內生産時間";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部採購的缺省倉儲位置 默認為0200";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼 默認爲000";
                        PLA_Safty_Stock.ToolTip = "安全庫存 僅Low Sefi";
                        PLA_Availability_Check.ToolTip = "可用性檢查組 Top Sefi:KP,Low Sefi: stock mamg:Z1,else:KP";
                        PLA_Period_Indicator.ToolTip = "期間標識 默認爲M";
                        PLA_Selection_Method.ToolTip = "選擇可替換物料單的方法 默認爲3";
                        PLA_Individual_Coll.ToolTip = "對于獨立和集中需求的相關需求標識 默認為2";
                        PLA_Unlimited.ToolTip = "標識：允許未限制的過量交貨 默認打勾";
                        PLA_Unit_of_issue.ToolTip = "髮貨單位 DECO默認為L";
                        PLA_Product_Scheduling.ToolTip = "生産計劃參數文件 默認爲Z00001";
                    }
                    if (FORM == "FORM-T011" || FORM == "FORM-T011-1")
                    {
                        if (FORM == "FORM-T011-1")
                        {
                            PLA_Plant.ToolTip = "需要擴展的生産工廠";
                            PLA_Production_Planner.ToolTip = "仅当Top SEFI需要";
                            PLA_Safety_Stock_Method.ToolTip = "仅当Top SEFI需要，默认02";
                            PLA_SNP_Planner.ToolTip = "仅当Top SEFI需要";
                        }
                        else
                        {
                            PLA_Plant.ToolTip = "需要擴展的生産工廠 DECO的默認為KT2P";
                        }
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位 默認為0200 0035 0060 0090";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態 MTO創建時爲ZF，MTS創建時爲ZC,最後都爲ZG";
                        PLA_MRP_Group.ToolTip = "物料需求計劃組 默认为SEFI";
                        PLA_MRP_Type.ToolTip = "物料需求計劃類型 Top Sefi默認為M0, Low Sefi默認為PD";
                        PLA_MRP_Controller.ToolTip = "MRP控製者（物料計劃人） Top Sefi:ESP,Low Sefi:ESL";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃）";
                        PLA_Minimum_Lot_Size.ToolTip = "最小批量";
                        PLA_Maximum_Lot_Size.ToolTip = "最大批量";
                        PLA_Fix_Lot_Size.ToolTip = "固定批量大小 若Lot Size爲FX則必填";
                        PLA_Procurement_Type.ToolTip = "采購類型 默認為E";
                        PLA_Prod_Stor_Loc.ToolTip = "髮貨庫存地點 默認為0200";
                        PLA_In_house_Production_Time.ToolTip = "場內生産時間";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部採購的缺省倉儲位置 默認為0200";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼 默認爲000";
                        PLA_Safty_Stock.ToolTip = "安全庫存 僅Low Sefi";
                        PLA_Availability_Check.ToolTip = "可用性檢查組 Top Sefi:KP,Low Sefi: stock mamg:Z1,else:KP";
                        PLA_Period_Indicator.ToolTip = "期間標識 默認爲M";
                        PLA_Selection_Method.ToolTip = "選擇可替換物料單的方法 默認爲3";
                        PLA_Individual_Coll.ToolTip = "對于獨立和集中需求的相關需求標識 默認為2";
                        PLA_Unlimited.ToolTip = "標識：允許未限制的過量交貨 默認打勾";
                        //PLA_Unit_of_issue.ToolTip = "髮貨單位 DECO默認為L";
                        PLA_Product_Scheduling.ToolTip = "生産計劃參數文件 默認爲Z00001";
                    }
                    if (FORM == "FORM-T007")
                    {
                        PLA_Plant.ToolTip = "需要擴展的生産工廠";
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態";
                        PLA_MRP_Group.ToolTip = "物料需求計劃組";
                        PLA_MRP_Controller.ToolTip = "MRP控製着（物料計劃人）";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃）";
                        PLA_Fix_Lot_Size.ToolTip = "固定批量大小（若Lot Size爲FX則必填）";
                        PLA_Minimum_Lot_Size.ToolTip = "最小批量";
                        PLA_Maximum_Lot_Size.ToolTip = "最大批量";
                        PLA_Procurement_Type.ToolTip = "采購類型";
                        PLA_Prod_Stor_Loc.ToolTip = "髮貨庫存地點";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部採購的缺省倉儲位置";
                        PLA_In_house_Production_Time.ToolTip = "場內生産時間";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼";
                        PLA_Safty_Stock.ToolTip = "安全庫存";
                        PLA_Availability_Check.ToolTip = "可用性檢查組 Top Sefi:KP,Low Sefi: stock mamg:Z1,else:KP";
                        PLA_Period_Indicator.ToolTip = "期間標識";
                        PLA_Selection_Method.ToolTip = "選擇可替換物料単的方法";
                        PLA_Individual_Coll.ToolTip = "對于獨立和集中需求的相關需求標識";
                        PLA_Unlimited.ToolTip = "標識：允許未限制的過量交貨";
                        PLA_Unit_of_issue.ToolTip = "發貨單位";
                        PLA_Product_Scheduling.ToolTip = "生産計劃參數文件";
                        PLA_SNP_Planner.ToolTip = "仅当Top SEFI需要";
                        PLA_Safety_Stock_Method.ToolTip = "仅当Top SEFI需要，默认02";
                        PLA_Production_Planner.ToolTip = "仅当Top SEFI需要";
                    }
                    break;
                case "FINI":
                case "TRADE":
                    PLA_ABC_Indicator.ToolTip = "ABC标识";
                    PLA_Availability_Check.ToolTip = "可用性检查的检查组";
                    PLA_Bwd_Comsumption.ToolTip = "向后消耗期间";
                    PLA_Consumption_Mode.ToolTip = "消耗模式";
                    PLA_Do_Not_Cost.ToolTip = "无成本核算(Y: 不参与成本核算 N: 参与成本核算)";
                    PLA_Fix_Lot_Size.ToolTip = "固定批量值";
                    PLA_Forecast_Model.ToolTip = "预测模型";
                    PLA_GR_Processing_Time.ToolTip = "以天计的收货处理时间";
                    PLA_Individual_Coll.ToolTip = "对于独立和集中需求的相关需求标识";
                    PLA_In_house_Production_Time.ToolTip = "厂内生产时间(天)";
                    PLA_Lot_Size.ToolTip = "批量";
                    PLA_Maximum_Lot_Size.ToolTip = "最大批量值";
                    PLA_Minimum_Lot_Size.ToolTip = "最小批量值";
                    PLA_MRP_Controller.ToolTip = "MRP 控制者";
                    PLA_MRP_Group.ToolTip = "物料需求计划组";
                    PLA_MRP_Type.ToolTip = "物料需求计划类型";
                    PLA_Period_Indicator.ToolTip = "期间标识(默认为M: Monthly)";
                    PLA_Planned_Delivery_Time.ToolTip = "计划内的交货时间(天)";
                    PLA_Planning_Material.ToolTip = "计划物料";
                    PLA_Planning_Plant.ToolTip = "计划工厂";
                    PLA_Plant.ToolTip = "需要扩展的工厂";
                    PLA_Plant_Sp_Matl_Status.ToolTip = "工厂特定的物料状态";
                    PLA_Procurement_Type.ToolTip = "采购类型(E 内部生产 F 外部获取)";
                    PLA_Prod_Stor_Loc.ToolTip = "发货库存地点";
                    PLA_Rounding_Value.ToolTip = "采购订单数量的舍入值";
                    PLA_Safty_Stock.ToolTip = "安全库存(不与安全时间同时使用)";
                    PLA_Safety_Time_Ind.ToolTip = "安全时间标识(与安全库存同时使用)";
                    PLA_Safety_Time_Act_Cov.ToolTip = "安全时间(不与安全库存同时使用)(天)";
                    PLA_SchedMargin_Key.ToolTip = "浮动的计划边际码(默认为000)";
                    PLA_Selection_Method.ToolTip = "选择可替换物料单的方法";
                    PLA_Special_Procurement.ToolTip = "特殊获取类型(仅当Procurement type=“F”时填写)";
                    PLA_Stock_Det_Grp.ToolTip = "库存确定组";
                    PLA_Storage_Location.ToolTip = "需要扩展的仓位";
                    PLA_With_Qty_Struture.ToolTip = "物料根据数量结构进行成本核算";
                    PLA_ICD.ToolTip = "是否需要内部采购";
                    PLA_Purchasing_Group.ToolTip = "仅在D-Plant使用";
                    PLA_Storage_Loc_For_EP_L.ToolTip = "外部采购的缺省仓储位置";
                    PLA_Overdely_Tol.ToolTip = "超量交货容差限制";
                    PLA_Plng_Conv_Factor.ToolTip = "计划物料的转换因子";
                    PLA_Planning_Matl_BUnit.ToolTip = "计划物料的基准计量单位";
                    PLA_Fwd_Comsumption.ToolTip = "向前冲销期间";

                    if (FORM == "FORM-001")
                    {
                        PLA_With_Qty_Struture.ToolTip = "物料根据结构进行成本计算(默认：N)";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工厂特定的物料状态(默认：ZD)";
                        PLA_Do_Not_Cost.ToolTip = "无成本核算（打勾: 不参与成本核算不打勾: 参与成本核算）";
                    }

                    if (FORM == "FORM-064" || FORM == "FORM-074")
                    {
                        PLA_Plant.ToolTip = "需要扩展的工厂(默认：K51D)";
                        PLA_Storage_Location.ToolTip = "需要扩展的仓位 (默认 0010,0035,0050,0060,0070,0090)";
                        PLA_Availability_Check.ToolTip = "可用性检查的检查组 (默认：Z1)";
                        PLA_MRP_Group.ToolTip = "物料需求计划组 (默认：FINI)";
                        PLA_MRP_Type.ToolTip = "物料需求计划类型 (默认：PD)";
                        PLA_MRP_Controller.ToolTip = "MRP控制者 (默认：001)";
                        PLA_Lot_Size.ToolTip = "批量 (默认：EX)";
                        PLA_Safety_Time_Act_Cov.ToolTip = "安全时间 不与安全库存同时使用";
                        PLA_Procurement_Type.ToolTip = "采购类型 (默认F:外部获取/转仓)";
                        PLA_Special_Procurement.ToolTip = "特殊获取类型 (默认：20)";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部采购的缺省仓储位置 (默认：0010)";
                        PLA_Stock_Det_Grp.ToolTip = "库存确定组 (默认：0001)";
                        PLA_Purchasing_Group.ToolTip = "采购组 (默认：K03)";
                        PLA_Strategy_Group.ToolTip = "计划策略组 (默认：40)";
                    }
                    if (FORM == "FORM-015")
                    {
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工厂特定的物料状态(默认为ZG)";
                        PLA_Storage_Location.ToolTip = "需要扩展的仓位(默认为0010)";
                        PLA_Availability_Check.ToolTip = "可用性检查的检查组 (默认：Z1)";
                    }
                    if (FORM.IndexOf("T") != -1)
                    {

                        PLA_Plant_1.ToolTip = "需擴展的工廠";
                        PLA_Storage_Location_1.ToolTip = "需要擴展的倉位";
                        PLA_Plant_Sp_Matl_Status_1.ToolTip = "工廠特定的物料狀態";
                        PLA_MRP_Group_1.ToolTip = "物料需求計劃組";
                        PLA_MRP_Type_1.ToolTip = "物料需求計劃類型";
                        PLA_MRP_Controller_1.ToolTip = "MRP控製者（物料計劃人）";
                        PLA_Lot_Size_1.ToolTip = "批量（物料計劃） ";
                        PLA_Storage_Loc_For_EP_1.ToolTip = "外部採購的缺省倉儲位置";
                        PLA_Procurement_Type_1.ToolTip = "采購類型";
                        PLA_GR_Processing_Time_1.ToolTip = "以天計的收貨處理時間";
                        PLA_SchedMargin_Key_1.ToolTip = "浮動的計劃邊際碼";
                        PLA_Period_Indicator_1.ToolTip = "期間標識";
                        PLA_Availability_Check_1.ToolTip = "可用性檢查的檢查組";
                        PLA_Unlimited_1.ToolTip = "標識：允許未限制過量的交貨";
                        PLA_Selection_Method_1.ToolTip = "選擇可替換物料單的方法";
                        PLA_Product_Scheduling.ToolTip = "生産計劃參數文件，僅P-Plant默認爲Z00001";
                        PLA_In_house_Production_Time_1.ToolTip = "場內生產時間";

                        PLA_Plant.ToolTip = "需擴展的工廠";
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位";
                        PLA_Purchasing_Group.ToolTip = "採購組";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態 創建時爲ZC,最後爲ZG";
                        PLA_MRP_Group.ToolTip = "物料需求計劃組";
                        PLA_MRP_Type.ToolTip = "物料需求計劃類型";
                        PLA_MRP_Controller.ToolTip = "MRP控製者（物料計劃人）";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃） ";
                        PLA_ABC_Indicator.ToolTip = "ABC標識";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部採購的缺省倉儲位置";
                        PLA_Procurement_Type.ToolTip = "采購類型";
                        PLA_Special_Procurement.ToolTip = "特殊采購類型";
                        PLA_Planned_Delivery_Time.ToolTip = "計劃的天數內交貨";
                        PLA_GR_Processing_Time.ToolTip = "以天計的收貨處理時間";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼";
                        PLA_Safty_Stock.ToolTip = "安全庫存";
                        PLA_Safety_Time_Ind.ToolTip = "安全時間標識（含或不含安全時間)";
                        PLA_Strategy_Group.ToolTip = "計劃策略組";
                        PLA_Safety_Time_Act_Cov.ToolTip = "安全時間（按工作日計算）";
                        PLA_Consumption_Mode.ToolTip = "消耗模式";
                        PLA_Fwd_Comsumption.ToolTip = "消耗時期-向前";
                        PLA_Bwd_Comsumption.ToolTip = "消耗期間-逆嚮";
                        PLA_Forecast_Model.ToolTip = "預測模型";
                        PLA_Period_Indicator.ToolTip = "期間標識";
                        PLA_Individual_Coll.ToolTip = "對於獨立和集中需求的相關標識";
                        PLA_Maximum_Lot_Size.ToolTip = "最大批量";
                        PLA_Minimum_Lot_Size.ToolTip = "最小批量";
                        PLA_In_house_Production_Time.ToolTip = "場內生産時間";
                        PLA_Prod_Stor_Loc.ToolTip = "發貨庫存地點";
                        PLA_Unlimited.ToolTip = "標識：允許未限制的過量交貨";
                        PLA_Selection_Method.ToolTip = "選擇可替換物料單的方法";
                        PLA_Source_List.ToolTip = "標識：源清單要求";
                        PLA_Backflush.ToolTip = "標識：反衝";
                        PLA_Rounding_Value.ToolTip = "采購訂單數量的舍入值";
                        PLA_Fix_Lot_Size.ToolTip = "固定批量大小，若Lot Size爲FX則必填";
                        PLA_Unit_of_issue.ToolTip = "髮貨單位";
                        PLA_Forecast_Model.ToolTip = "預測模型";
                        PLA_Availability_Check.ToolTip = "可用性檢查組";
                        PLA_Fix_Lot_Size.ToolTip = "固定批量大小，若Lot Size爲FX則必填";
                        if (FORM == "FORM-T010")
                        {
                            PLA_Availability_Check.ToolTip = "可用性檢查組,默認爲Z3";
                        }
                        if (FORM == "FORM-TW-011")
                        {
                            PLA_Availability_Check.ToolTip = "可用性檢查組，Top Sefi:KP,Low Sefi: stock mamg:Z1,else:KP";
                            PLA_Safety_Stock_Method.ToolTip = "仅当Top SEFI需要，默认02";
                            PLA_SNP_Planner.ToolTip = "仅当Top SEFI需要";
                            PLA_Production_Planner.ToolTip = "仅当Top SEFI需要";
                        }
                        if (FORM == "FORM-TW-010")
                        {
                            PLA_Special_Procurement.ToolTip = "特殊采購類型，僅KT1D默認為W1";
                            PLA_Forecast_Model.ToolTip = "預測模型，僅KT1D默認為N";
                            PLA_SNP_Planner.ToolTip = "SNP计划员P-Plant & D-Plant,仅当Forecast model=N(MTS)时需要";
                            PLA_Safety_Stock_Method.ToolTip = "D-Plant默认02P-Plant默认为空,仅当Forecast model=N(MTS)时需要";
                            PLA_Production_Planner.ToolTip = "生产计划员P-Plant & D-Plant,仅当Forecast model=N(MTS)时需要";
                        }
                        if (FORM == "FORM-TW-007-1" || FORM == "FORM-TW-011")
                        {
                            PLA_Safty_Stock.ToolTip = "安全庫存，僅Low Sefi";
                            PLA_Selection_Method.ToolTip = "選擇可替換物料單的方法，僅KT1P默認為3";
                            PLA_Product_Scheduling.ToolTip = "生産計劃參數文件";
                            PLA_Fwd_Comsumption.ToolTip = "髮貨單位";
                            PLA_SNP_Planner.ToolTip = "仅当Top SEFI需要";
                            PLA_Production_Planner.ToolTip = "仅当Top SEFI需要";
                        }
                        if (FORM == "FORM-TW-007")
                        {
                            PLA_Special_Procurement.ToolTip = "特殊采購類型，僅KT1D默認為W1";
                            PLA_Purchasing_Group.ToolTip = "採購組 僅KT1D默認為ZFM";
                            PLA_ABC_Indicator.ToolTip = "ABC標識，僅KT1D";
                            PLA_In_house_Production_Time.ToolTip = "場內生産時間，僅KT1P必填";
                            PLA_Planned_Delivery_Time.ToolTip = "計劃的天數內交貨，僅KT1D默認為1天";
                            PLA_Safty_Stock.ToolTip = "安全庫存，僅KT1D";
                            PLA_Safety_Time_Ind.ToolTip = "安全時間標識（含或不含安全時間），僅KT1D";
                            PLA_Safety_Time_Act_Cov.ToolTip = "安全時間（按工作日計算），僅KT1D";
                            PLA_Strategy_Group.ToolTip = "計劃策略組，僅KT1D默認為40";
                            PLA_Consumption_Mode.ToolTip = "消耗模式，僅KT1D默認為2";
                            PLA_Fwd_Comsumption.ToolTip = "消耗時期-向前，僅KT1D默認為15天";
                            PLA_Bwd_Comsumption.ToolTip = "消耗期間-逆嚮，僅KT1D默認為15天";
                            PLA_Forecast_Model.ToolTip = "預測模型，僅KT1D默認為N";
                            PLA_Selection_Method.ToolTip = "選擇可替換物料單的方法，僅KT1P默認為3";
                            PLA_Unlimited.ToolTip = "標識：允許未限制的過量交貨，僅P-Plant默認打勾";
                            PLA_Rounding_Value.ToolTip = "采購訂單數量的捨入值僅KT1P";
                            PLA_SNP_Planner.ToolTip = "SNP计划员P-Plant & D-Plant,仅当Forecast model=N(MTS)时需要";
                            PLA_Safety_Stock_Method.ToolTip = "D-Plant默认02P-Plant默认为空,仅当Forecast model=N(MTS)时需要";
                            PLA_Production_Planner.ToolTip = "生产计划员P-Plant & D-Plant,仅当Forecast model=N(MTS)时需要";
                        }
                    }
                    if (FORM == "FORM-T009" || FORM == "FORM-T012")
                    {
                        PLA_Plant.ToolTip = "需擴展的工廠";
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位 默認為0010 0035 0060 0090";
                        PLA_Purchasing_Group.ToolTip = "採購組 默認為K03";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態 默認爲ZG";
                        PLA_MRP_Group.ToolTip = "物料需求計劃組 默認為FINI";
                        PLA_MRP_Type.ToolTip = "物料需求計劃類型 默認為Z1";
                        PLA_MRP_Controller.ToolTip = "MRP控製者（物料計劃人） 默認為TRD";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃） 默認為EX";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部採購的缺省倉儲位置 默認為0010";
                        PLA_Procurement_Type.ToolTip = "采購類型 默認為F";
                        PLA_Special_Procurement.ToolTip = "特殊采購類型 默認為20";
                        PLA_Planned_Delivery_Time.ToolTip = "計劃的天數內交貨 必填";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼 默認爲000";
                        PLA_Safty_Stock.ToolTip = "安全庫存";
                        PLA_Safety_Time_Ind.ToolTip = "安全時間標識（含或不含安全時間)";
                        PLA_Strategy_Group.ToolTip = "計劃策略組 默認為40";
                        PLA_Safety_Time_Act_Cov.ToolTip = "安全時間（按工作日計算）";
                        PLA_Consumption_Mode.ToolTip = "消耗模式";
                        PLA_Fwd_Comsumption.ToolTip = "消耗期間－向前";
                        PLA_Availability_Check.ToolTip = "可用性檢查的檢查組";
                        PLA_Bwd_Comsumption.ToolTip = "消耗期間-逆向";
                        PLA_Forecast_Model.ToolTip = "預測模型 默認爲N";
                        PLA_Period_Indicator.ToolTip = "期間標識 默認爲M";
                        PLA_Source_List.ToolTip = "標識：源清單要求 默認打勾";
                    }
                    if (FORM == "FORM-T003")
                    {
                        PLA_Plant.ToolTip = "需要擴展的生産工廠";
                        PLA_Storage_Location.ToolTip = "需要擴展的倉位 必填";
                        PLA_Purchasing_Group.ToolTip = "採購組 默認爲K01";
                        PLA_Source_List.ToolTip = "標識：源清單要求 默認打勾";
                        PLA_Plant_Sp_Matl_Status.ToolTip = "工廠特定的物料狀態 默認爲ZG";
                        PLA_ABC_Indicator.ToolTip = "ABC標識";
                        PLA_MRP_Type.ToolTip = "物料需求計劃類型 默認為PD";
                        PLA_MRP_Controller.ToolTip = "MRP控製者（物料計劃人） 默認爲ERP";
                        PLA_Lot_Size.ToolTip = "批量（物料計劃） 默認爲05";
                        PLA_Minimum_Lot_Size.ToolTip = "最小批量";
                        PLA_Procurement_Type.ToolTip = "采購類型 默認爲F";
                        PLA_Maximum_Lot_Size.ToolTip = "最大批量";
                        PLA_Special_Procurement.ToolTip = "特殊采購類型 必填";
                        PLA_Rounding_Value.ToolTip = "采購訂單數量的舍入值";
                        PLA_Backflush.ToolTip = "標識：反衝 默認爲1";
                        PLA_Prod_Stor_Loc.ToolTip = "發貨庫存地點 同Storage Location";
                        PLA_SchedMargin_Key.ToolTip = "浮動的計劃邊際碼 默認爲010";
                        PLA_Storage_Loc_For_EP.ToolTip = "外部采購的缺省倉儲位置 同Storage Location";
                        PLA_Planned_Delivery_Time.ToolTip = "計劃的天數內交貨";
                        PLA_Stock_Det_Grp.ToolTip = "庫存確定組 SPT爲10時，默認爲0001";
                        PLA_Safty_Stock.ToolTip = "安全庫存";
                        PLA_Safety_Time_Ind.ToolTip = "安全時間標識（含或不含安全時間）";
                        PLA_Availability_Check.ToolTip = "可用性檢查的檢查組 必填";
                        PLA_Safety_Time_Act_Cov.ToolTip = "安全時間（按工作日計算）";
                        PLA_Period_Indicator.ToolTip = "期間標識 默認爲M";
                        PLA_Individual_Coll.ToolTip = "對于獨立和集中需求的相關需求標識 默認爲2";
                        PLA_PO_Price.ToolTip = "采購價格";
                    }

                    break;
            }
        }
        #endregion

        #region 方法 DataValidation(数据验证)
        public List<string> DataValidation(mdc_Material mt, string Sheet)
        {
            //如果当前 Tabs 是隐藏的情况，退出
            Anthem.Label lb = new Anthem.Label(); lb.ForeColor = Color.Blue; lb.Attributes["v"] = "1";
            List<Regular> regs = new List<Regular>();
            if (!(IsUsed && (Action == "C" || Action == "E")))
            {
                if (TaskAPI.Process != "D-plant Determination")
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                }
                //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special Procurement为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Safety_Time_Act_Cov_L, mt.PLA_Safety_Time_Act_Cov, Sheet + "Safety time/act.cov 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Safty_Stock_L, mt.PLA_Safty_Stock, Sheet + "Safty Stock 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Safety_Time_Ind_L, mt.PLA_Safety_Time_Ind, Sheet + "Safety time ind.为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Bwd_Comsumption_L, mt.PLA_Bwd_Comsumption, Sheet + "Bwd Comsumption 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fwd_Comsumption_L, mt.PLA_Fwd_Comsumption, Sheet + "Fwd Comsumption 为必填");
                return Validation(regs);
            }
            if (TaskAPI.Process == "Fini Code Application" || TaskAPI.Process == "D-Plant Extend Application")
            {
                return Validation(regs);
            }
            if (TaskAPI.Process == "D-plant Determination")
            {
                if (Action == "C")
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                }
                return Validation(regs);
            }
            if (TaskAPI.Process == "Trade Code Application")
            {
                if (Action != "S")
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, mt.PLA_Plant, Sheet + "Plant为必填"));
                }
                return Validation(regs);
            }
            if ((TaskAPI.Process == "PKG Sefi Code BOM Application" || TaskAPI.Process == "PKG Fini Code BOM Application") && !(Page as PMDC).Code_Selected.Checked)
            {
                return Validation(regs);
            }
            if (TaskAPI.Process == "TW Raw Code Application" && FORM == "FORM-T003" && (Page as PMDC).rd_Raw_Code.SelectedIndex.ToString() == "0")
            {
                if ((this.PLA_Storage_Location.Visible) && (this.PLA_ABC_Indicator.Visible) && (this.PLA_Special_Procurement.Visible) && (this.PLA_PO_Price.Visible) && (this.PLA_Planned_Delivery_Time.Visible))
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Location_L, mt.PLA_Storage_Location, Sheet + "Storage Location爲必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_ABC_Indicator_L, mt.PLA_ABC_Indicator, Sheet + "ABC Indicator爲必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special procurement type爲必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planned_Delivery_Time_L, mt.PLA_Planned_Delivery_Time, Sheet + "Planned delivery time(days)爲必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_PO_Price_L, mt.PLA_PO_Price, Sheet + "PO Price爲必填");
                }
                return Validation(regs);

            }
            //else
            //{
            //    return Validation(regs);
            //}
            if (TaskAPI.Process == "TW Raw Code Application" && FORM == "FORM-T018" && (Page as PMDC).rd_Raw_Code.SelectedIndex.ToString() == "1")
            {
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Location_L, mt.PLA_Storage_Location, Sheet + "Storage Location爲必填");
                return Validation(regs);
            }
            //else
            //{
            //    return Validation(regs);
            //}
            if (FORM == "FORM-TW-011")
            {
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability Check 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days) 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");

                if (!string.IsNullOrEmpty(mt.PLA_Safety_Time_Ind) || !string.IsNullOrEmpty(mt.PLA_Safety_Time_Act_Cov))
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Ind, Sheet + "Safety time ind. 为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Act_Cov, Sheet + "Safety time/act.cov. 为必填");
                }
                return Validation(regs);
            }
            if (FORM == "FORM-TW-007")
            {
                if (!string.IsNullOrEmpty(mt.PLA_Safety_Time_Ind) || !string.IsNullOrEmpty(mt.PLA_Safety_Time_Act_Cov))
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Ind, Sheet + "Safety time ind. 为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Act_Cov, Sheet + "Safety time/act.cov. 为必填");
                }
                //Tang Bin 新添加
                if (TaskAPI.Process == "TW NPL Application-DECO" && TaskAPI.Step == "Planning")
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                }
                if (TaskAPI.Process == "TW FINI Code Application")
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability Check为必填");
                }
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days) 为必填");
                return Validation(regs);
            }

            if (FORM == "FORM-TW-010" || FORM == "FORM-TW-007-1")
            {
                if (TaskAPI.Process == "TW NPL Application-PKG")
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_1_L, mt.PLA_Availability_Check_1, Sheet + "Availability Check 为必填");
                }
                if (!string.IsNullOrEmpty(mt.PLA_Safety_Time_Ind) || !string.IsNullOrEmpty(mt.PLA_Safety_Time_Act_Cov))
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Ind, Sheet + "Safety time ind. 为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Act_Cov, Sheet + "Safety time/act.cov. 为必填");
                }
                if (FORM == "FORM-TW-007-1")
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                }
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_1_L, mt.PLA_Lot_Size_1, Sheet + "Lot Size为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability Check 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days) 为必填");
                if (FORM == "FORM-TW-010")
                {
                    if (this.PLA_Availability_Check_1.Visible)
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_1_L, mt.PLA_Availability_Check_1, Sheet + "Availability Check 必填");
                    }
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_1_L, mt.PLA_MRP_Type_1, Sheet + "MRP Type为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_1_L, mt.PLA_In_house_Production_Time_1, Sheet + "Inhouse production time(days) 为必填");
                }
                return Validation(regs);
            }
            if (FORM == "FORM-TW-004")
            {
                if (!string.IsNullOrEmpty(mt.PLA_Safety_Time_Ind) || !string.IsNullOrEmpty(mt.PLA_Safety_Time_Act_Cov))
                {
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Ind, Sheet + "Safety time ind. 为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Act_Cov, Sheet + "Safety time/act.cov. 为必填");
                }
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Purchasing_Group_L, mt.PLA_Purchasing_Group, Sheet + "Purchasing Group 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_ABC_Indicator_L, mt.PLA_ABC_Indicator, Sheet + "ABC Indicator为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability Check 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special procurement type 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planned_Delivery_Time_L, mt.PLA_Planned_Delivery_Time, Sheet + "Planned delivery time(days) 为必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_PO_Price_L, (mt.PLA_PO_Price + "").Trim(), Sheet + "PO Price为必填");

                return Validation(regs);
            }
            if (FORM == "FORM-T007" && this.PLA_Backflush_L.Visible && this.PLA_Lot_Size_L.Visible && this.PLA_In_house_Production_Time_L.Visible && this.PLA_Availability_Check_L.Visible && this.PLA_Fix_Lot_Size_L.Visible)
            {
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size 爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days)爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability check 爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size 爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_Backflush_L, mt.PLA_Backflush, Sheet + "Backflush 爲必填");
                return Validation(regs);
            }
            if (FORM == "FORM-T011-1" && this.PLA_Backflush_L.Visible && this.PLA_Lot_Size_L.Visible && this.PLA_In_house_Production_Time_L.Visible && this.PLA_Availability_Check_L.Visible && this.PLA_Fix_Lot_Size_L.Visible)
            {
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size 爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days)爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability check 爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size 爲必填");
                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, this.PLA_Backflush_L, mt.PLA_Backflush, Sheet + "Backflush 爲必填");
                return Validation(regs);
            }

            switch (Category)
            {
                case "SEFI":
                    if (TaskAPI.Process == "NPL Master Data Application")
                    {
                        SetNPLPlant(mt.PLA_Plant);
                        if (mt.SheetStep == TaskAPI.Step)
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Plant, Sheet + "Plant为必填");

                        if (mt.PLA_Plant.Length > 0)
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Purchasing_Group_L, mt.PLA_Purchasing_Group, Sheet + "Purchasing Group为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Procurement_Type_L, mt.PLA_Procurement_Type, Sheet + "Procurement type为必填");
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special Procurement为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Overdely_Tol_L, mt.PLA_Overdely_Tol, Sheet + " Overdely tol.为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Minimum_Lot_Size_L, mt.PLA_Minimum_Lot_Size, Sheet + "Minimum lot size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Maximum_Lot_Size_L, mt.PLA_Maximum_Lot_Size, Sheet + "Maximum lot size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_Sp_Matl_Status_L, mt.PLA_Plant_Sp_Matl_Status, Sheet + "Plant-sp.matl status为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Material_L, mt.PLA_Planning_Material, Sheet + "Planning Material为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Plant_L, mt.PLA_Planning_Plant, Sheet + "Planning Plant为必填");
                        }
                    }
                    else if (TaskAPI.Process == "P-Plant Extend Application")
                    {
                        return Validation(regs);
                    }

                    else if (TaskAPI.Process == "TW MTO Application-DECO" && FORM == "FORM-T008")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days)爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability check 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size 爲必填");
                        return Validation(regs);
                    }
                    else if (TaskAPI.Process == "TW MTO Application-PKG" && FORM == "FORM-T011")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_L, mt.PLA_In_house_Production_Time, Sheet + "Inhouse production time(days)爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability check 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size 爲必填");
                        return Validation(regs);
                    }

                    else
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                        if (this.PLA_Fix_Lot_Size_L.Visible)
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                        }
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Purchasing_Group_L, mt.PLA_Purchasing_Group, Sheet + "Purchasing Group为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Procurement_Type_L, mt.PLA_Procurement_Type, Sheet + "Procurement type为必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special Procurement为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Overdely_Tol_L, mt.PLA_Overdely_Tol, Sheet + " Overdely tol.为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Minimum_Lot_Size_L, mt.PLA_Minimum_Lot_Size, Sheet + "Minimum lot size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Maximum_Lot_Size_L, mt.PLA_Maximum_Lot_Size, Sheet + "Maximum lot size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_Sp_Matl_Status_L, mt.PLA_Plant_Sp_Matl_Status, Sheet + "Plant-sp.matl status为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Material_L, mt.PLA_Planning_Material, Sheet + "Planning Material为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Plant_L, mt.PLA_Planning_Plant, Sheet + "Planning Plant为必填");
                    }
                    //if (TaskAPI.Process == "P-Plant Extend Application")
                    //{
                    //    return Validation(regs);
                    //}
                    break;
                case "RAW":
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_With_Qty_Struture_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");

                    break;

                case "PACK":
                    if (TaskAPI.Process == "NPL Master Data Application")
                    {
                        SetNPLPlant(mt.PLA_Plant);
                        if (mt.SheetStep == TaskAPI.Step)
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Plant, Sheet + "Plant为必填");

                        if (mt.PLA_Plant.Length > 0)
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Minimum_Lot_Size_L, mt.PLA_Minimum_Lot_Size, Sheet + "Minimum lot size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Maximum_Lot_Size_L, mt.PLA_Maximum_Lot_Size, Sheet + "Maximum lot size为必填");
                        }
                    }
                    //else if (TaskAPI.Process == "P-Plant Extend Application" && !(Parent as PMDC).PackCode_Selected.Checked)
                    //{
                    //    return Validation(regs);
                    //}
                    else
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Minimum_Lot_Size_L, mt.PLA_Minimum_Lot_Size, Sheet + "Minimum lot size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Maximum_Lot_Size_L, mt.PLA_Maximum_Lot_Size, Sheet + "Maximum lot size为必填");
                    }
                    break;

                case "FINI":
                    if (TaskAPI.Process == "NPL Master Data Application" && TaskAPI.Step != "Logistic")
                    {
                        SetNPLPlant(mt.PLA_Plant);
                        if (mt.SheetStep == TaskAPI.Step)
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Plant, Sheet + "Plant为必填");

                        if (mt.PLA_Plant.Length > 0)
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Location_L, mt.PLA_Storage_Location, Sheet + "Storage Location为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_ICD_L, mt.PLA_ICD, Sheet + "ICD(Y/N)为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                            if (mt.PLA_Lot_Size.StartsWith("FX"))
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");

                            if (mt.PLA_Plant.Length > 0 && mt.PLA_Plant.EndsWith("D"))
                            {
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Purchasing_Group_L, mt.PLA_Purchasing_Group, Sheet + "Purchasing Group为必填");
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Strategy_Group_L, mt.PLA_Strategy_Group, Sheet + "Strategy Group为必填");
                            }

                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Procurement_Type_L, mt.PLA_Procurement_Type, Sheet + "Procurement type为必填");
                            if (mt.PLA_Procurement_Type.StartsWith("F"))
                                //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Special_Procurement, Sheet + "Special Procurement为必填");

                                if (mt.PLA_Plant.Length > 0 && mt.PLA_Plant.EndsWith("P"))
                                {
                                    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                                }

                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Overdely_Tol_L, mt.PLA_Overdely_Tol, Sheet + " Overdely tol.为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Minimum_Lot_Size_L, mt.PLA_Minimum_Lot_Size, Sheet + "Minimum lot size为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Maximum_Lot_Size_L, mt.PLA_Maximum_Lot_Size, Sheet + "Maximum lot size为必填");
                            //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_With_Qty_Struture_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_With_Qty_Struture_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Group_L, mt.PLA_MRP_Group, Sheet + "MRP Group 为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_ABC_Indicator_L, mt.PLA_ABC_Indicator, Sheet + "ABC Indicator为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability check为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Selection_Method_L, mt.PLA_Selection_Method, Sheet + "Selection method为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Bwd_Comsumption_L, mt.PLA_Bwd_Comsumption, Sheet + "Bwd Comsumption 为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fwd_Comsumption_L, mt.PLA_Fwd_Comsumption, Sheet + "Fwd Comsumption 为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Rounding_Value_L, mt.PLA_Rounding_Value, Sheet + "Rounding Value 为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planned_Delivery_Time_L, mt.PLA_Planned_Delivery_Time, Sheet + "Planned delivery time 为必填");
                            if (!string.IsNullOrEmpty(mt.PLA_Safety_Time_Ind) || !string.IsNullOrEmpty(mt.PLA_Safety_Time_Act_Cov))
                            {
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Ind, Sheet + "Safety time ind. 为必填");
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Safety_Time_Act_Cov, Sheet + "Safety time/act.cov. 为必填");
                            }
                            if (Type == "1" || Type == "2")
                            {
                                switch (mt.PLA_Consumption_Mode)
                                {
                                    case "1":
                                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Bwd_Comsumption, Sheet + "Bwd consumption per. 为必填");
                                        break;
                                    case "2":
                                    case "4":
                                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Bwd_Comsumption, Sheet + "Bwd consumption per. 为必填");
                                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Fwd_Comsumption, Sheet + "Fwd consumption per. 为必填");
                                        break;
                                    case "3":
                                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Fwd_Comsumption, Sheet + "Fwd consumption per. 为必填");
                                        break;
                                }
                            }

                            if (mt.PLA_Planning_Material.Trim().Length > 0 || mt.PLA_Planning_Plant.Trim().Length > 0 || mt.PLA_Plng_Conv_Factor.Trim().Length > 0 || mt.PLA_Planning_Matl_BUnit.Trim().Length > 0)
                            {
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Planning_Material, Sheet + "Planning Material为必填");
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Planning_Plant, Sheet + "Planning Plant为必填");
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Plng_Conv_Factor, Sheet + "Plng conv. Factor为必填");
                                akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Planning_Matl_BUnit, Sheet + "Planning matl Bunit为必填");
                            }
                        }
                    }
                    //else if (TaskAPI.Process == "PKG Fini Code BOM Application")
                    //{
                    ////    //if (FORM == "FORM-031-1")
                    ////    //{
                    ////        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                    ////        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                    ////        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Plant_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                    ////    //}
                    ////    //if (FORM == "FORM-031-2")
                    ////    //{
                    ////    //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                    ////    //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                    ////    //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Plant_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                    ////    //}
                    //}

                    if (TaskAPI.Process == "TW Trade Code Application-DECO" && FORM == "FORM-T009")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planned_Delivery_Time_L, mt.PLA_Planned_Delivery_Time, Sheet + "Planned Delivery Time 必填");
                        return Validation(regs);
                    }

                    if (FORM == "FORM-T006" || FORM == "FORM-T010")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_In_house_Production_Time_1_L, mt.PLA_In_house_Production_Time_1, Sheet + "In house production time(days) 爲必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_1_L, mt.PLA_Availability_Check_1, Sheet + "Availability Check 爲必填");
                        return Validation(regs);
                    }


                    else if (TaskAPI.Process != "TW Raw Code Application")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Plant_L, mt.PLA_Plant, Sheet + "Plant为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Location_L, mt.PLA_Storage_Location, Sheet + "Storage Location为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_ICD_L, mt.PLA_ICD, Sheet + "ICD(Y/N)为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fix_Lot_Size_L, mt.PLA_Fix_Lot_Size, Sheet + "Fix Lot Size为必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_With_Qty_Struture_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                        if (mt.PLA_Plant.Length > 0 && mt.PLA_Plant.EndsWith("D"))
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Purchasing_Group_L, mt.PLA_Purchasing_Group, Sheet + "Purchasing Group为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Storage_Loc_For_EP_L, mt.PLA_Storage_Loc_For_EP, Sheet + "Storage loc.for EP为必填");
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Strategy_Group_L, mt.PLA_Strategy_Group, Sheet + "Strategy Group为必填");
                        }
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Procurement_Type_L, mt.PLA_Procurement_Type, Sheet + "Procurement type为必填");
                        //akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special Procurement为必填");
                        if (mt.PLA_Plant.Length > 0 && mt.PLA_Plant.EndsWith("P"))
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Prod_Stor_Loc_L, mt.PLA_Prod_Stor_Loc, Sheet + "Prod. Stor. Loc为必填");
                        }
                        string s = mt.PLA_Planning_Material + mt.PLA_Planning_Plant + mt.PLA_Plng_Conv_Factor + mt.PLA_Planning_Matl_BUnit;
                        if (string.IsNullOrEmpty(s))
                        {
                        }
                        else
                        {
                            akzo_RegularCheck(ref regs, RegularExp.NotEmpty, lb, mt.PLA_Plant_Sp_Matl_Status, Sheet + "Plant-sp.matl status为必填");
                        }
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Overdely_Tol_L, mt.PLA_Overdely_Tol, Sheet + " Overdely tol.为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Minimum_Lot_Size_L, mt.PLA_Minimum_Lot_Size, Sheet + "Minimum lot size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Maximum_Lot_Size_L, mt.PLA_Maximum_Lot_Size, Sheet + "Maximum lot size为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_With_Qty_Struture_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");

                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_ABC_Indicator_L, mt.PLA_ABC_Indicator, Sheet + "ABC Indicator为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Availability_Check_L, mt.PLA_Availability_Check, Sheet + "Availability check为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Selection_Method_L, mt.PLA_Selection_Method, Sheet + "Selection method为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Bwd_Comsumption_L, mt.PLA_Bwd_Comsumption, Sheet + "Bwd Comsumption 为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Fwd_Comsumption_L, mt.PLA_Fwd_Comsumption, Sheet + "Fwd Comsumption 为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Rounding_Value_L, mt.PLA_Rounding_Value, Sheet + "Rounding Value 为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planned_Delivery_Time_L, mt.PLA_Planned_Delivery_Time, Sheet + "Planned delivery time 为必填");

                    }

                    if (TaskAPI.Process == "HK-MTO Base Code Application")
                    {
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planned_Delivery_Time_L, mt.PLA_Planned_Delivery_Time, Sheet + "Planned delivery time 为必填");
                        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Special_Procurement_L, mt.PLA_Special_Procurement, Sheet + "Special Procurement 为必填");
                    }
                    //if (TaskAPI.Process == "PKG Fini Code BOM Application" && (Parent as TabMaterial).Status.KeyWord == "MM1" || (Parent as TabMaterial).Status.KeyWord == "MM2" && (Page as PMDC).Code_Selected.Checked)
                    //{
                    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                    //    return Validation(regs);
                    //}
                    //if (TaskAPI.Process == "PKG Fini Code BOM Application")
                    //{
                    //    //if (FORM == "FORM-031-1")
                    //    //{
                    //    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                    //    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                    //    //    akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Plant_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                    //    //}
                    //    //if (FORM == "FORM-031-2")
                    //    //{
                    //        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Controller_L, mt.PLA_MRP_Controller, Sheet + "MRP Controller为必填");
                    //        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_MRP_Type_L, mt.PLA_MRP_Type, Sheet + "MRP Type为必填");
                    //        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Lot_Size_L, mt.PLA_Lot_Size, Sheet + "Lot Size为必填");
                    //        akzo_RegularCheck(ref regs, RegularExp.NotEmpty, PLA_Planning_Plant_L, mt.PLA_With_Qty_Struture, Sheet + "With Qty Struture为必填");
                    //    //}
                    //}

                    break;
            }

            return Validation(regs);
        }
        #endregion

        //NPL SET PLANT
        public void SetNPLPlant(string Plant)
        {
            if (TaskAPI.Process == "NPL Master Data Application" && TaskAPI.Step.IndexOf("Planning") >= 0 && (Category == "FINI" || Category == "PACK" || Category == "SEFI"))
            {
                if (TaskAPI.Step == SheetStep || Plant == TaskAPI.Step)
                {
                    SetEnable(true, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Strategy_Group, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Individual_Coll, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Minimum_Lot_Size);
                }
                if (PLA_Plant.SelectedValue.Length > 0 || Plant.Length > 0)
                {
                    SetEnable(true, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Individual_Coll, PLA_MRP_Controller);
                    SetForeColor(Color.Black, PLA_Plant_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L
                                             , PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L
                                             , PLA_With_Qty_Struture_L, PLA_Is_MTS_MTO_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L);
                    if (Category == "FINI")
                    {
                        SetForeColor(Color.Black, PLA_ICD_L, PLA_Availability_Check_L, PLA_MRP_Group_L, PLA_MRP_Controller_L);
                        SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Individual_Coll_L, PLA_Forecast_Model_L);

                        if (FORM == "FORM-064")
                        {
                            //SetForeColor(Color.Blue, PLA_Rounding_Value_L, PLA_Planned_Delivery_Time_L);
                        }

                        if (FORM == "FORM-074")
                        {
                            SetForeColor(Color.Blue, PLA_Plant_Sp_Matl_Status_L);
                        }

                        //if (FORM == "FORM-031" && (Parent as TabMaterial).Status.KeyWord == "MM1")
                        //{
                        //    SetForeColor(Color.Black, PLA_Storage_Loc_For_EP_L);
                        //}
                    }

                    if (Category == "SEFI")
                    {
                        if (Category == "SEFI" && FORM == "FORM-035")
                        {
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                        }
                        SetForeColor(Color.Black, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Storage_Loc_For_EP_L);
                        SetForeColor(Color.Blue, PLA_MRP_Controller_L);
                    }

                    if (Category == "PACK")
                    {
                        if (FORM == "FORM-043")
                        {
                            SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L, PLA_MRP_Controller_L);
                            SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                        }

                        SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L);
                        SetForeColor(Color.Black, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                    }

                    if (Category == "RAW")
                    {
                        SetForeColor(Color.Blue, PLA_Storage_Loc_For_EP_L, PLA_MRP_Controller_L, PLA_Lot_Size_L, PLA_Prod_Stor_Loc_L);
                        SetForeColor(Color.Black, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L);
                    }
                    SetDefaultValue();
                }
                else
                {
                    SetForeColor(Color.Black, PLA_Plant_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Procurement_Type_L
                                             , PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L
                                             , PLA_With_Qty_Struture_L, PLA_Is_MTS_MTO_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L,
                                             PLA_MRP_Group_L, PLA_Availability_Check_L
                                             );
                    SetEnable(false, PLA_FINI_Material_Code, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Strategy_Group, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Forecast_Model);
                }
                if (TaskAPI.Step == SheetStep || Plant == TaskAPI.Step)
                {
                    SetForeColor(Color.Blue, PLA_Plant_L);
                }
                else
                {
                    SetEnable(false, PLA_FINI_Material_Code, PLA_Plant, PLA_Storage_Location, PLA_ICD, PLA_IsPurchase, PLA_MRP_Controller, PLA_MRP_Type, PLA_Lot_Size, PLA_Purchasing_Group, PLA_Procurement_Type, PLA_Special_Procurement, PLA_Prod_Stor_Loc, PLA_MRP_Group, PLA_Fix_Lot_Size, PLA_Overdely_Tol, PLA_Unlimited, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Rounding_Value, PLA_In_house_Production_Time, PLA_Planned_Delivery_Time, PLA_GR_Processing_Time, PLA_Safety_Time_Act_Cov, PLA_Safty_Stock, PLA_Safety_Time_Ind, PLA_Stock_Det_Grp, PLA_With_Qty_Struture, PLA_Valuation_Class, PLA_Forecast_Model, PLA_Plant_Sp_Matl_Status, PLA_Do_Not_Cost, PLA_Is_MTS_MTO, PLA_ABC_Indicator, PLA_Backflush, PLA_Individual_Coll, PLA_Planning_Material, PLA_Planning_Plant, PLA_Selection_Method, PLA_Availability_Check, PLA_SchedMargin_Key, PLA_Period_Indicator, PLA_Deletion_Flag, PLA_Consumption_Mode, PLA_Bwd_Comsumption, PLA_Fwd_Comsumption, PLA_Storage_Loc_For_EP, PLA_Strategy_Group, PLA_Storage_Loc_For_EP, PLA_Plng_Conv_Factor, PLA_Planning_Matl_BUnit, PLA_Strategy_Group, PLA_Individual_Coll, PLA_Minimum_Lot_Size, PLA_Maximum_Lot_Size, PLA_Minimum_Lot_Size);
                    SetForeColor(Color.Black, PLA_Plant_L, PLA_FINI_Material_Code_L, PLA_Storage_Location_L, PLA_ICD_L, PLA_IsPurchase_L, PLA_MRP_Controller_L, PLA_MRP_Type_L, PLA_Lot_Size_L, PLA_Purchasing_Group_L, PLA_Procurement_Type_L, PLA_Special_Procurement_L, PLA_Prod_Stor_Loc_L, PLA_MRP_Group_L, PLA_Fix_Lot_Size_L, PLA_Overdely_Tol_L, PLA_Unlimited_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Rounding_Value_L, PLA_In_house_Production_Time_L, PLA_Planned_Delivery_Time_L, PLA_GR_Processing_Time_L, PLA_Safety_Time_Act_Cov_L, PLA_Safty_Stock_L, PLA_Safety_Time_Ind_L, PLA_Stock_Det_Grp_L, PLA_With_Qty_Struture_L, PLA_Valuation_Class_L, PLA_Forecast_Model_L, PLA_Plant_Sp_Matl_Status_L, PLA_Do_Not_Cost_L, PLA_Is_MTS_MTO_L, PLA_ABC_Indicator_L, PLA_Backflush_L, PLA_Individual_Coll_L, PLA_Planning_Material_L, PLA_Planning_Plant_L, PLA_Selection_Method_L, PLA_Availability_Check_L, PLA_SchedMargin_Key_L, PLA_Period_Indicator_L, PLA_Deletion_Flag_L, PLA_Consumption_Mode_L, PLA_Bwd_Comsumption_L, PLA_Fwd_Comsumption_L, PLA_Storage_Loc_For_EP_L, PLA_Strategy_Group_L, PLA_Minimum_Lot_Size_L, PLA_Maximum_Lot_Size_L, PLA_Purchasing_Group_L);
                }
            }
        }

        #region Production Planner
        //Tang Bin新添加 PLA_Production_Planner
        public void PLA_Production_Planner_TextChanged(object sender, EventArgs e)
        {
            if (TaskAPI.Process == "TW NPL Application-DECO" && FORM == "FORM-TW-007-1")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
            if (TaskAPI.Process == "TW NPL Application-DECO" && FORM == "FORM-TW-007" && TaskAPI.Step == "Planning")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text.ToString();
            }
            if (TaskAPI.Process == "TW NPL Application-PKG" && FORM == "FORM-TW-010")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
            if (TaskAPI.Process == "TW NPL Application-PKG" && FORM == "FORM-TW-011")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
            if (TaskAPI.Process == "TW FINI Code Application" && FORM == "FORM-TW-007")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
            if (TaskAPI.Process == "TW FINI Code Application" && FORM == "FORM-TW-010")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
            if (TaskAPI.Process == "TW SEFI Code Application" && FORM == "FORM-T007")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
            if (TaskAPI.Process == "TW SEFI Code Application" && FORM == "FORM-T011-1")
            {
                PLA_SNP_Planner.Text = PLA_Production_Planner.Text;
            }
        }
        #endregion

        #region Strategy_Group与Forcast Model联动
        protected void PLA_Strategy_Group_SelectedIndexChanged(object sender, EventArgs e)
        {
            if ((TaskAPI.Process == "NPL Master Data Application" || TaskAPI.Process == "P-Plant Extend Application" || TaskAPI.Process == "D-Plant Extend Application") && (FORM == "FORM-010" || FORM == "FORM-005"))
            {
                SetEnable(false, PLA_Forecast_Model);
                if (PLA_Strategy_Group.SelectedValue == "40")
                {
                    PLA_Forecast_Model.SelectedValue = "N";
                }
                else if (PLA_Strategy_Group.SelectedValue == "96")
                {
                    if (!string.IsNullOrEmpty(PLA_Planning_Material.Text))
                    {
                        PLA_Forecast_Model.SelectedValue = "0";
                    }

                    if (string.IsNullOrEmpty(PLA_Planning_Material.Text))
                    {
                        PLA_Forecast_Model.SelectedValue = "N";
                    }

                }
                else
                {
                    PLA_Forecast_Model.SelectedValue = "0";
                }
            }
        }
        #endregion


    }
}